mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Bluetooth: Don't enforce authentication for L2CAP PSM 1 and 3
The recommendation for the L2CAP PSM 1 (SDP) is to not use any kind of authentication or encryption. So don't trigger authentication for incoming and outgoing SDP connections. For L2CAP PSM 3 (RFCOMM) there is no clear requirement, but with Bluetooth 2.1 the initiator is required to enable authentication and encryption first and this gets enforced. So there is no need to trigger an additional authentication step. The RFCOMM service security will make sure that a secure enough link key is present. When the encryption gets enabled after the SDP connection setup, then switch the security level from SDP to low security. Signed-off-by: Marcel Holtmann <[email protected]>
This commit is contained in:
parent
6a8d3010b3
commit
435fef20ac
2 changed files with 7 additions and 1 deletions
|
|
@ -805,7 +805,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_
|
|||
l2cap_pi(sk)->sport = la->l2_psm;
|
||||
sk->sk_state = BT_BOUND;
|
||||
|
||||
if (btohs(la->l2_psm) == 0x0001)
|
||||
if (btohs(la->l2_psm) == 0x0001 || btohs(la->l2_psm) == 0x0003)
|
||||
l2cap_pi(sk)->sec_level = BT_SECURITY_SDP;
|
||||
}
|
||||
|
||||
|
|
@ -852,6 +852,9 @@ static int l2cap_do_connect(struct sock *sk)
|
|||
auth_type = HCI_AT_NO_BONDING_MITM;
|
||||
else
|
||||
auth_type = HCI_AT_NO_BONDING;
|
||||
|
||||
if (l2cap_pi(sk)->sec_level == BT_SECURITY_LOW)
|
||||
l2cap_pi(sk)->sec_level = BT_SECURITY_SDP;
|
||||
} else {
|
||||
switch (l2cap_pi(sk)->sec_level) {
|
||||
case BT_SECURITY_HIGH:
|
||||
|
|
|
|||
Loading…
Reference in a new issue