Skip to content

Commit eca9443

Browse files
mkarhumaatorvalds
authored andcommitted
Bluetooth: Fix faulty expression for minimum encryption key size check
Fix minimum encryption key size check so that HCI_MIN_ENC_KEY_SIZE is also allowed as stated in the comment. This bug caused connection problems with devices having maximum encryption key size of 7 octets (56-bit). Fixes: 693cd8c ("Bluetooth: Fix regression with minimum encryption key size alignment") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203997 Signed-off-by: Matias Karhumaa <matias.karhumaa@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6e692c3 commit eca9443

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/bluetooth/l2cap_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ static bool l2cap_check_enc_key_size(struct hci_conn *hcon)
13531353
* actually encrypted before enforcing a key size.
13541354
*/
13551355
return (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags) ||
1356-
hcon->enc_key_size > HCI_MIN_ENC_KEY_SIZE);
1356+
hcon->enc_key_size >= HCI_MIN_ENC_KEY_SIZE);
13571357
}
13581358

13591359
static void l2cap_do_start(struct l2cap_chan *chan)

0 commit comments

Comments
 (0)