Skip to content

Commit 03dba9c

Browse files
committed
Bluetooth: L2CAP: Fix not responding with L2CAP_CR_LE_ENCRYPTION
Depending on the security set the response to L2CAP_LE_CONN_REQ shall be just L2CAP_CR_LE_ENCRYPTION if only encryption when BT_SECURITY_MEDIUM is selected since that means security mode 2 which doesn't require authentication which is something that is covered in the qualification test L2CAP/LE/CFC/BV-25-C. Link: bluez/bluez#1270 Fixes: 27e2d4c ("Bluetooth: Add basic LE L2CAP connect request receiving support") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 0fb410c commit 03dba9c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/bluetooth/l2cap_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4870,7 +4870,8 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,
48704870

48714871
if (!smp_sufficient_security(conn->hcon, pchan->sec_level,
48724872
SMP_ALLOW_STK)) {
4873-
result = L2CAP_CR_LE_AUTHENTICATION;
4873+
result = pchan->sec_level == BT_SECURITY_MEDIUM ?
4874+
L2CAP_CR_LE_ENCRYPTION : L2CAP_CR_LE_AUTHENTICATION;
48744875
chan = NULL;
48754876
goto response_unlock;
48764877
}

0 commit comments

Comments
 (0)