aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorWaldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>2011-06-02 08:24:52 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-06-08 15:58:19 -0400
commitef4177e2bf92543e422fae154888062376e2283d (patch)
tree800ea51c1c36ce3f2f39b8480616a4a3a634291e /net/bluetooth/hci_conn.c
parent14b12d0b98f87162b7e9e93dde66d1af97886567 (diff)
Bluetooth: Simplify hci_conn_accept_secure check
If the link key is secure (authenticated or combination 16 digit) the sec_level will be always BT_SECURITY_HIGH. Therefore, instead of checking the link key type simply check the sec_level on the link. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 0408a93570d6..37f5a174f072 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -643,9 +643,7 @@ int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level)
643 if (sec_level != BT_SECURITY_HIGH) 643 if (sec_level != BT_SECURITY_HIGH)
644 return 1; /* Accept if non-secure is required */ 644 return 1; /* Accept if non-secure is required */
645 645
646 if (conn->key_type == HCI_LK_AUTH_COMBINATION || 646 if (conn->sec_level == BT_SECURITY_HIGH)
647 (conn->key_type == HCI_LK_COMBINATION &&
648 conn->pin_length == 16))
649 return 1; 647 return 1;
650 648
651 return 0; /* Reject not secure link */ 649 return 0; /* Reject not secure link */