Bluetooth: Classic: SMP: Store derived LK if SMP_FLAG_BOND
is set
When deriving the new LK, remove the old LK if it exists. Store the derived LK if the flag `SMP_FLAG_BOND` of LE SMP is set. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit is contained in:
parent
001397653b
commit
3bf18870f9
1 changed files with 11 additions and 0 deletions
|
@ -810,6 +810,12 @@ static void sc_derive_link_key(struct bt_smp *smp)
|
|||
return;
|
||||
}
|
||||
|
||||
/* Remove the bonding information */
|
||||
link_key = bt_keys_find_link_key(&conn->le.dst.a);
|
||||
if (link_key != NULL) {
|
||||
bt_keys_link_key_clear(link_key);
|
||||
}
|
||||
|
||||
/*
|
||||
* At this point remote device identity is known so we can use
|
||||
* destination address here
|
||||
|
@ -855,6 +861,11 @@ static void sc_derive_link_key(struct bt_smp *smp)
|
|||
} else {
|
||||
link_key->flags &= ~BT_LINK_KEY_AUTHENTICATED;
|
||||
}
|
||||
|
||||
if (atomic_test_bit(smp->flags, SMP_FLAG_BOND)) {
|
||||
/* Store the link key */
|
||||
bt_keys_link_key_store(link_key);
|
||||
}
|
||||
}
|
||||
|
||||
static void smp_br_reset(struct bt_smp_br *smp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue