Skip to content

Commit b788ceb

Browse files
Vudentzgregkh
authored andcommitted
Bluetooth: L2CAP: Fix not responding with L2CAP_CR_LE_ENCRYPTION
[ Upstream commit 03dba9c ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 2a98786 commit b788ceb

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
@@ -4835,7 +4835,8 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,
48354835

48364836
if (!smp_sufficient_security(conn->hcon, pchan->sec_level,
48374837
SMP_ALLOW_STK)) {
4838-
result = L2CAP_CR_LE_AUTHENTICATION;
4838+
result = pchan->sec_level == BT_SECURITY_MEDIUM ?
4839+
L2CAP_CR_LE_ENCRYPTION : L2CAP_CR_LE_AUTHENTICATION;
48394840
chan = NULL;
48404841
goto response_unlock;
48414842
}

0 commit comments

Comments
 (0)