How to require encrypted notifications in STM32_WPAN
In `ble_defs.h`, we have the following security permissions for attributes:
/* Security permissions for an attribute
*/
#define ATTR_PERMISSION_NONE 0x00U /* No security. */
#define ATTR_PERMISSION_AUTHEN_READ 0x01U /* Need authentication to read */
#define ATTR_PERMISSION_AUTHOR_READ 0x02U /* Need authorization to read */
#define ATTR_PERMISSION_ENCRY_READ 0x04U /* Need encryption to read */
#define ATTR_PERMISSION_AUTHEN_WRITE 0x08U /* Need authentication to write */
#define ATTR_PERMISSION_AUTHOR_WRITE 0x10U /* Need authorization to write */
#define ATTR_PERMISSION_ENCRY_WRITE 0x20U /* Need encryption to write */In particular, we have permissions to ensure ecryption of read and write operations, but no permissions to ensure encryption for notification, indication, or write-without-response.
If I create a characteristic with the write-without-response property and the encrypted write permission, then performing a write-without-response operation on that characteristic does not seem to trigger an "insufficient encryption" error on the central device and therefore does not trigger a pairing request on iOS.
However, if I create the same characteristic with the write property and the encrypted write permission, performing a write operation *does* trigger an "insufficient encryption" error and pairing request.
This makes me think the ATTR_PERMISSION_ENCRY_WRITE permission does not apply to write-without-response.
So, I am wondering how we can ensure that a particular notification, indication, or write-without-response is encrypted.
Thanks!
