diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-09-10 20:37:45 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-09-10 20:45:24 -0400 |
commit | a6f7833ca353d50de46e3532afebe4abfc5dc4d9 (patch) | |
tree | 81813ae82ad5069a9880b2918de7548ccbd9a61b /net/bluetooth/hci_event.c | |
parent | 1afc2a1ab6612dcc3f26db7ca1afba9cff359f1c (diff) |
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/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 3a8381ab992f..603a17cc52ac 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -4506,10 +4506,7 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
4506 | memcpy(cp.ltk, ltk->val, sizeof(ltk->val)); | 4506 | memcpy(cp.ltk, ltk->val, sizeof(ltk->val)); |
4507 | cp.handle = cpu_to_le16(conn->handle); | 4507 | cp.handle = cpu_to_le16(conn->handle); |
4508 | 4508 | ||
4509 | if (ltk->authenticated) | 4509 | conn->pending_sec_level = smp_ltk_sec_level(ltk); |
4510 | conn->pending_sec_level = BT_SECURITY_HIGH; | ||
4511 | else | ||
4512 | conn->pending_sec_level = BT_SECURITY_MEDIUM; | ||
4513 | 4510 | ||
4514 | conn->enc_key_size = ltk->enc_size; | 4511 | conn->enc_key_size = ltk->enc_size; |
4515 | 4512 | ||