summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/smp.c
diff options
context:
space:
mode:
authorJohan Hedberg2014-09-11 02:37:45 +0200
committerMarcel Holtmann2014-09-11 02:45:24 +0200
commita6f7833ca353d50de46e3532afebe4abfc5dc4d9 (patch)
tree81813ae82ad5069a9880b2918de7548ccbd9a61b /net/bluetooth/smp.c
parentBluetooth: Fix SMP security level when we have no IO capabilities (diff)
downloadkernel-qcow2-linux-a6f7833ca353d50de46e3532afebe4abfc5dc4d9.tar.gz
kernel-qcow2-linux-a6f7833ca353d50de46e3532afebe4abfc5dc4d9.tar.xz
kernel-qcow2-linux-a6f7833ca353d50de46e3532afebe4abfc5dc4d9.zip
Bluetooth: Add smp_ltk_sec_level() helper function
There are several places that need to determine the security level that an LTK can provide. This patch adds a convenience function for this to help make the code more readable. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r--net/bluetooth/smp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index a08b077cb725..3700dd8d9d0b 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1114,7 +1114,7 @@ static bool smp_ltk_encrypt(struct l2cap_conn *conn, u8 sec_level)
if (!key)
return false;
- if (sec_level > BT_SECURITY_MEDIUM && !key->authenticated)
+ if (smp_ltk_sec_level(key) < sec_level)
return false;
if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags))