Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134738
b: refs/heads/master
c: 00ae4af
h: refs/heads/master
v: v3
  • Loading branch information
Marcel Holtmann committed Feb 27, 2009
1 parent c7d6720 commit e6345cc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2950f21acb0f6b8fcd964485c2ebf1e06545ac20
refs/heads/master: 00ae4af91d8c5b6814e2bb3bfaaf743845f989eb
30 changes: 20 additions & 10 deletions trunk/net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,26 @@ static inline int l2cap_check_security(struct sock *sk)
struct l2cap_conn *conn = l2cap_pi(sk)->conn;
__u8 auth_type;

switch (l2cap_pi(sk)->sec_level) {
case BT_SECURITY_HIGH:
auth_type = HCI_AT_GENERAL_BONDING_MITM;
break;
case BT_SECURITY_MEDIUM:
auth_type = HCI_AT_GENERAL_BONDING;
break;
default:
auth_type = HCI_AT_NO_BONDING;
break;
if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) {
if (l2cap_pi(sk)->sec_level == BT_SECURITY_HIGH)
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:
auth_type = HCI_AT_GENERAL_BONDING_MITM;
break;
case BT_SECURITY_MEDIUM:
auth_type = HCI_AT_GENERAL_BONDING;
break;
default:
auth_type = HCI_AT_NO_BONDING;
break;
}
}

return hci_conn_security(conn->hcon, l2cap_pi(sk)->sec_level,
Expand Down

0 comments on commit e6345cc

Please sign in to comment.