Skip to content

Commit 4be1d91

Browse files
joerchancarlescufi
authored andcommitted
[nrf fromtree] Bluetooth: host: Overwrite existing bond when IRK has ...
been updated Overwrite the existing bond when the IRK of the existing bond could not resolve the RPA of the peer. This would happen if the peer has deleted the bond and replaced the IRK that was used. Signed-off-by: Joakim Andersson <[email protected]> (cherry picked from commit e06bac0) Signed-off-by: Joakim Andersson <[email protected]>
1 parent 916d0d8 commit 4be1d91

File tree

1 file changed

+12
-0
lines changed
  • subsys/bluetooth/host

1 file changed

+12
-0
lines changed

subsys/bluetooth/host/smp.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3792,6 +3792,18 @@ static uint8_t smp_ident_addr_info(struct bt_smp *smp, struct net_buf *buf)
37923792
return BT_SMP_ERR_INVALID_PARAMS;
37933793
}
37943794

3795+
if (bt_addr_le_cmp(&conn->le.dst, &req->addr) != 0) {
3796+
struct bt_keys *keys = bt_keys_find_addr(conn->id, &req->addr);
3797+
3798+
if (keys) {
3799+
if (!update_keys_check(smp, keys)) {
3800+
return BT_SMP_ERR_UNSPECIFIED;
3801+
}
3802+
3803+
bt_keys_clear(keys);
3804+
}
3805+
}
3806+
37953807
if (atomic_test_bit(smp->flags, SMP_FLAG_BOND)) {
37963808
const bt_addr_le_t *dst;
37973809
struct bt_keys *keys;

0 commit comments

Comments
 (0)