Skip to content

Commit d9ff7eb

Browse files
Thalleyhenrikbrixandersen
authored andcommitted
Bluetooth: GATT: Add missing LESC_MASK for encrypt check
The LE Secure connection (LESC) mask also require encryption, and some users have been using e.g. BT_GATT_PERM_READ_LESC without BT_GATT_PERM_READ_ENCRYPT, and then the encryption check in bt_gatt_check_perm was never properly applied. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 073871b commit d9ff7eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/bluetooth/host/gatt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3113,7 +3113,8 @@ uint8_t bt_gatt_check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr
31133113
* the error code “Insufficient Encryption”.
31143114
*/
31153115

3116-
if (mask & (BT_GATT_PERM_ENCRYPT_MASK | BT_GATT_PERM_AUTHEN_MASK)) {
3116+
if (mask &
3117+
(BT_GATT_PERM_ENCRYPT_MASK | BT_GATT_PERM_AUTHEN_MASK | BT_GATT_PERM_LESC_MASK)) {
31173118
#if defined(CONFIG_BT_SMP)
31183119
if (!conn->encrypt) {
31193120
if (bt_conn_ltk_present(conn)) {

0 commit comments

Comments
 (0)