Skip to content
/ linux Public

Commit c859b45

Browse files
VudentzSasha Levin
authored andcommitted
Bluetooth: L2CAP: Fix response to L2CAP_ECRED_CONN_REQ
[ Upstream commit 05761c2 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 31f2340 commit c859b45

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
@@ -6111,7 +6111,8 @@ static inline int l2cap_ecred_conn_req(struct l2cap_conn *conn,
61116111

61126112
if (!smp_sufficient_security(conn->hcon, pchan->sec_level,
61136113
SMP_ALLOW_STK)) {
6114-
result = L2CAP_CR_LE_AUTHENTICATION;
6114+
result = pchan->sec_level == BT_SECURITY_MEDIUM ?
6115+
L2CAP_CR_LE_ENCRYPTION : L2CAP_CR_LE_AUTHENTICATION;
61156116
goto unlock;
61166117
}
61176118

0 commit comments

Comments
 (0)