Message ID | 20250409085307.635819-1-frederic.danis@collabora.com |
---|---|
State | Accepted |
Commit | 50c1241e6a8a89deec03f5186df5824abf45e080 |
Headers | show |
Series | [v2] Bluetooth: l2cap: Check encryption key size on incoming connection | expand |
Hello: This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Wed, 9 Apr 2025 10:53:06 +0200 you wrote: > This is required for passing GAP/SEC/SEM/BI-04-C PTS test case: > Security Mode 4 Level 4, Responder - Invalid Encryption Key Size > - 128 bit > > This tests the security key with size from 1 to 15 bytes while the > Security Mode 4 Level 4 requests 16 bytes key size. > > [...] Here is the summary with links: - [v2] Bluetooth: l2cap: Check encryption key size on incoming connection https://git.kernel.org/bluetooth/bluetooth-next/c/50c1241e6a8a You are awesome, thank you!
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index c7b66b2ea9f2..f1c4b8bd7a8b 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -3991,7 +3991,8 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, /* Check if the ACL is secure enough (if not SDP) */ if (psm != cpu_to_le16(L2CAP_PSM_SDP) && - !hci_conn_check_link_mode(conn->hcon)) { + (!hci_conn_check_link_mode(conn->hcon) || + !l2cap_check_enc_key_size(conn->hcon))) { conn->disc_reason = HCI_ERROR_AUTH_FAILURE; result = L2CAP_CR_SEC_BLOCK; goto response;