Skip to content

Commit 05761c2

Browse files
committed
Bluetooth: L2CAP: Fix response to L2CAP_ECRED_CONN_REQ
Similar to 03dba9c ("Bluetooth: L2CAP: Fix not responding with L2CAP_CR_LE_ENCRYPTION") the result code L2CAP_CR_LE_ENCRYPTION shall be used when BT_SECURITY_MEDIUM is set since that means security mode 2 which mean it doesn't require authentication which results in qualification test L2CAP/ECFC/BV-32-C failing. Link: bluez/bluez#1871 Fixes: 15f02b9 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent 5c4e9a8 commit 05761c2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/bluetooth/l2cap_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5112,7 +5112,8 @@ static inline int l2cap_ecred_conn_req(struct l2cap_conn *conn,
51125112

51135113
if (!smp_sufficient_security(conn->hcon, pchan->sec_level,
51145114
SMP_ALLOW_STK)) {
5115-
result = L2CAP_CR_LE_AUTHENTICATION;
5115+
result = pchan->sec_level == BT_SECURITY_MEDIUM ?
5116+
L2CAP_CR_LE_ENCRYPTION : L2CAP_CR_LE_AUTHENTICATION;
51165117
goto unlock;
51175118
}
51185119

0 commit comments

Comments
 (0)