Bluetooth: Add check fo connection encrypt flag in ATT
This checks if connection encrypt flag is set if attribute requires encryption and in case the connection is already encrypted return success. Change-Id: I8af4e9786b63a21f478b3aa9f6df448d7f5760c5 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
8f6edeebb8
commit
0000a2d790
1 changed files with 1 additions and 2 deletions
|
@ -571,8 +571,7 @@ static uint8_t check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr,
|
|||
return BT_ATT_ERR_AUTHENTICATION;
|
||||
}
|
||||
|
||||
if (mask & BT_GATT_PERM_ENCRYPT_MASK) {
|
||||
/* TODO: Check conn encryption */
|
||||
if ((mask & BT_GATT_PERM_ENCRYPT_MASK) && !conn->encrypt) {
|
||||
return BT_ATT_ERR_INSUFFICIENT_ENCRYPTION;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue