diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-09-11 02:37:45 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-09-11 02:45:24 +0200 |
commit | a6f7833ca353d50de46e3532afebe4abfc5dc4d9 (patch) | |
tree | 81813ae82ad5069a9880b2918de7548ccbd9a61b /net/bluetooth/smp.c | |
parent | Bluetooth: Fix SMP security level when we have no IO capabilities (diff) | |
download | linux-a6f7833ca353d50de46e3532afebe4abfc5dc4d9.tar.xz 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.c | 2 |
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)) |