Bluetooth: Set the correct security level for SC LTKs
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 23 May 2014 10:36:10 +0000 (13:36 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 3 Dec 2014 15:51:15 +0000 (16:51 +0100)
When the looked-up LTK is one generated by Secure Connections pairing
the security level it gives is BT_SECURITY_FIPS. This patch updates the
LTK request event handler to correctly set this level.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/smp.h

index 81d24c0ea08b60e77eeb154a18892d193742ba3f..f955d6b7ceb2b3749ebc6b67e6944128af8c8565 100644 (file)
@@ -163,8 +163,12 @@ static inline bool smp_ltk_is_sc(struct smp_ltk *key)
 
 static inline u8 smp_ltk_sec_level(struct smp_ltk *key)
 {
-       if (key->authenticated)
-               return BT_SECURITY_HIGH;
+       if (key->authenticated) {
+               if (smp_ltk_is_sc(key))
+                       return BT_SECURITY_FIPS;
+               else
+                       return BT_SECURITY_HIGH;
+       }
 
        return BT_SECURITY_MEDIUM;
 }