aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>2011-06-02 14:24:52 +0200
committerJaikumar Ganesh <jaikumar@google.com>2011-07-11 11:59:17 -0700
commit8b00cf0995d246b2d0fa3e1f1b52b073eafec611 (patch)
treea4e046264bb7acc419a697b02658842e9ff5df41
parent514abe61e146e18b256782fe959d8686a420c133 (diff)
downloadkernel_samsung_tuna-8b00cf0995d246b2d0fa3e1f1b52b073eafec611.zip
kernel_samsung_tuna-8b00cf0995d246b2d0fa3e1f1b52b073eafec611.tar.gz
kernel_samsung_tuna-8b00cf0995d246b2d0fa3e1f1b52b073eafec611.tar.bz2
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>
-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 fa0cfbf..8a707b5 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -654,9 +654,7 @@ int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level)
if (sec_level != BT_SECURITY_HIGH)
return 1; /* Accept if non-secure is required */
- if (conn->key_type == HCI_LK_AUTH_COMBINATION ||
- (conn->key_type == HCI_LK_COMBINATION &&
- conn->pin_length == 16))
+ if (conn->sec_level == BT_SECURITY_HIGH)
return 1;
return 0; /* Reject not secure link */