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>
This commit is contained in:
committed by
Marcel Holtmann
parent
fa37c1aa30
commit
35dc6f834c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user