diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-11-13 10:55:18 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-15 01:46:49 +0100 |
commit | 35dc6f834c9dc888391c7b700130d0831a907ca1 (patch) | |
tree | 24b259e7c459dd1a6f75bd79c572e5e5560ef975 /net/bluetooth/smp.h | |
parent | fa37c1aa30e538329b64dd55f401334f4bff47f5 (diff) |
Bluetooth: Add key preference parameter to smp_sufficient_security
So far smp_sufficient_security() has returned false if we're encrypted
with an STK but do have an LTK available. However, for the sake of LE
CoC servers we do want to let the incoming connection through even
though we're only encrypted with the STK.
This patch adds a key preference parameter to smp_sufficient_security()
with two possible values (enum used instead of bool for readability).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/smp.h')
-rw-r--r-- | net/bluetooth/smp.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/bluetooth/smp.h b/net/bluetooth/smp.h index 86a683a8b491..f76083b85005 100644 --- a/net/bluetooth/smp.h +++ b/net/bluetooth/smp.h @@ -133,8 +133,15 @@ static inline u8 smp_ltk_sec_level(struct smp_ltk *key) return BT_SECURITY_MEDIUM; } +/* Key preferences for smp_sufficient security */ +enum smp_key_pref { + SMP_ALLOW_STK, + SMP_USE_LTK, +}; + /* SMP Commands */ -bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level); +bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level, + enum smp_key_pref key_pref); int smp_conn_security(struct hci_conn *hcon, __u8 sec_level); int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey); |