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/l2cap_core.c | |
parent | fa37c1aa30e538329b64dd55f401334f4bff47f5 (diff) | |
download | op-kernel-dev-35dc6f834c9dc888391c7b700130d0831a907ca1.zip op-kernel-dev-35dc6f834c9dc888391c7b700130d0831a907ca1.tar.gz |
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/l2cap_core.c')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 7604549..a37f809 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -5391,7 +5391,8 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn, mutex_lock(&conn->chan_lock); l2cap_chan_lock(pchan); - if (!smp_sufficient_security(conn->hcon, pchan->sec_level)) { + if (!smp_sufficient_security(conn->hcon, pchan->sec_level, + SMP_ALLOW_STK)) { result = L2CAP_CR_AUTHENTICATION; chan = NULL; goto response_unlock; |