Bluetooth: Classic: SMP: Set BT_LINK_KEY_SC only if BT_KEYS_SC is set
The flag `BT_LINK_KEY_SC` of LK will also be set when derive LK from LTK. It is a incorrect behavior. The flag `BT_LINK_KEY_SC` should only be set if the flag `BT_KEYS_SC` of LTK has been set. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit is contained in:
parent
2695d2228b
commit
001397653b
1 changed files with 5 additions and 1 deletions
|
@ -844,7 +844,11 @@ static void sc_derive_link_key(struct bt_smp *smp)
|
|||
bt_keys_link_key_clear(link_key);
|
||||
}
|
||||
|
||||
link_key->flags |= BT_LINK_KEY_SC;
|
||||
if (conn->le.keys->flags & BT_KEYS_SC) {
|
||||
link_key->flags |= BT_LINK_KEY_SC;
|
||||
} else {
|
||||
link_key->flags &= ~BT_LINK_KEY_SC;
|
||||
}
|
||||
|
||||
if (conn->le.keys->flags & BT_KEYS_AUTHENTICATED) {
|
||||
link_key->flags |= BT_LINK_KEY_AUTHENTICATED;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue