Bluetooth: host: Terminate the pairing procedure when disconnected
Terminate the pairing procedure when disconnected while this was in progress. This notifies the application that security has failed and removes the key entry. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
6b72e6584c
commit
09eb7e066b
1 changed files with 7 additions and 0 deletions
|
@ -4506,6 +4506,13 @@ static void bt_smp_disconnected(struct bt_l2cap_chan *chan)
|
|||
|
||||
k_delayed_work_cancel(&smp->work);
|
||||
|
||||
if (atomic_test_bit(smp->flags, SMP_FLAG_PAIRING) ||
|
||||
atomic_test_bit(smp->flags, SMP_FLAG_ENC_PENDING) ||
|
||||
atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ)) {
|
||||
/* reset context and report */
|
||||
smp_pairing_complete(smp, BT_SMP_ERR_UNSPECIFIED);
|
||||
}
|
||||
|
||||
if (keys) {
|
||||
/*
|
||||
* If debug keys were used for pairing remove them.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue