summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-16 22:49:41 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-16 22:49:41 -0400
commitd46d4d64a85c6ff6118b33afd5d63bcb7e4be54a (patch)
tree007fb7d1cfbccac15d7c7551927372ba46777428 /net/bluetooth/hci_conn.c
parent2142c131a3e290ae350f8a0b0d354c0585a96df1 (diff)
parente00cf3b9eb7839b952e434a75bff6b99e47337ac (diff)
downloadlinux-d46d4d64a85c6ff6118b33afd5d63bcb7e4be54a.tar.bz2
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 7f5ad8a2b22d..3163330cd4f1 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -623,6 +623,23 @@ encrypt:
}
EXPORT_SYMBOL(hci_conn_security);
+/* Check secure link requirement */
+int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level)
+{
+ BT_DBG("conn %p", conn);
+
+ 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))
+ return 1;
+
+ return 0; /* Reject not secure link */
+}
+EXPORT_SYMBOL(hci_conn_check_secure);
+
/* Change link key */
int hci_conn_change_link_key(struct hci_conn *conn)
{