diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-05-12 14:06:10 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-12 14:06:10 -0400 |
commit | 15cb309614f35df344b9f06a9ea9f077d1e449db (patch) | |
tree | 85e244564f42381be5bf9d81ed867bb793fa976d /net/bluetooth/hci_conn.c | |
parent | 4daf50f20256e0022c87c1609226e971a70c82fd (diff) | |
parent | 55183d06cd1bd939ceccdad628b0aae12c86b803 (diff) | |
download | kernel_samsung_smdk4412-15cb309614f35df344b9f06a9ea9f077d1e449db.zip kernel_samsung_smdk4412-15cb309614f35df344b9f06a9ea9f077d1e449db.tar.gz kernel_samsung_smdk4412-15cb309614f35df344b9f06a9ea9f077d1e449db.tar.bz2 |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-next-2.6
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r-- | net/bluetooth/hci_conn.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 7f5ad8a..3163330 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) { |