Skip to content

Commit 4fce6fb

Browse files
sjanccarlescufi
authored andcommitted
Bluetooth: L2CAP: Fix checking if LTK is present
This fix a typo where incorrect member of bt_keys was used for checking if LTK is present. This was resulting in bogus results depending on connection role and current identity used. This was affecting L2CAP/LE/CFC/BV-25-C qualification test case. Fixes: #42862 Signed-off-by: Szymon Janc <[email protected]>
1 parent 777ddc0 commit 4fce6fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/bluetooth/host/l2cap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,9 +1054,9 @@ static uint16_t l2cap_check_security(struct bt_conn *conn,
10541054

10551055
if (keys) {
10561056
if (conn->role == BT_HCI_ROLE_CENTRAL) {
1057-
ltk_present = keys->id & (BT_KEYS_LTK_P256 | BT_KEYS_PERIPH_LTK);
1057+
ltk_present = keys->keys & (BT_KEYS_LTK_P256 | BT_KEYS_PERIPH_LTK);
10581058
} else {
1059-
ltk_present = keys->id & (BT_KEYS_LTK_P256 | BT_KEYS_LTK);
1059+
ltk_present = keys->keys & (BT_KEYS_LTK_P256 | BT_KEYS_LTK);
10601060
}
10611061
} else {
10621062
ltk_present = false;

0 commit comments

Comments
 (0)