Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- add a security level for writing the cccd (reading is always allowed) #62

Merged

Conversation

stemschmidt
Copy link

This might be related to #10:

It would be good to set the security level for writing a cccd.

Example:
You have a service for bi-directional communication. The service has a notification characteristic for receiving data and a write-no-response (for maximum throughput) for sending data. The communication should be encrypted.

Currently there is no trigger to enforce encryption even if both characteristics have a security level > SecurityLevel.OPEN

Being able to assign e.g. SecurityLevel.JUST_WORKS for writing to the cccd of the notification would trigger a "Insufficient Authentication" response which then results in a pairing/bonding

@stemschmidt
Copy link
Author

This is the part of the specification which I think is relevant: Chapter 3.3.3.3 Client Characteristic Configuration, BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part G

The table on page 1556 has this information in the Attribute Permission column:
Readable with no authentication or authorization.
Writable with authentication and authorization defined by a higher layer specification or is
implementation specific

So readable should always be allowed, writeable is implementation specific (mmmmh) or defined by a higher layer, which could be the definition of services and characteristics...

Copy link
Owner

@ThomasGerstenberg ThomasGerstenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Just one small change to request

blatann/gatt/gatts.py Outdated Show resolved Hide resolved
@stemschmidt
Copy link
Author

Sorry, that was nonsense... I remember I had the parameter somewhere else and faces some issues... I will update it...

@ThomasGerstenberg ThomasGerstenberg merged commit fdcf70c into ThomasGerstenberg:master Oct 23, 2020
@stemschmidt
Copy link
Author

Thank you!

@ThomasGerstenberg ThomasGerstenberg added this to the v0.3.5 milestone Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants