Skip to content

Commit 8d7aa9f

Browse files
sjanccarlescufi
authored andcommitted
[nrf fromtree] 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]> Signed-off-by: ilat <[email protected]> (cherry-pick of 4fce6fb)
1 parent b76ffd6 commit 8d7aa9f

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
@@ -1053,9 +1053,9 @@ static uint16_t l2cap_check_security(struct bt_conn *conn,
10531053

10541054
if (keys) {
10551055
if (conn->role == BT_HCI_ROLE_CENTRAL) {
1056-
ltk_present = keys->id & (BT_KEYS_LTK_P256 | BT_KEYS_PERIPH_LTK);
1056+
ltk_present = keys->keys & (BT_KEYS_LTK_P256 | BT_KEYS_PERIPH_LTK);
10571057
} else {
1058-
ltk_present = keys->id & (BT_KEYS_LTK_P256 | BT_KEYS_LTK);
1058+
ltk_present = keys->keys & (BT_KEYS_LTK_P256 | BT_KEYS_LTK);
10591059
}
10601060
} else {
10611061
ltk_present = false;

0 commit comments

Comments
 (0)