Skip to content

Commit ef512f2

Browse files
joerchannashif
authored andcommitted
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]>
1 parent 413eb08 commit ef512f2

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
@@ -3133,6 +3133,18 @@ static u8_t smp_ident_addr_info(struct bt_smp *smp, struct net_buf *buf)
31333133
return BT_SMP_ERR_INVALID_PARAMS;
31343134
}
31353135

3136+
if (bt_addr_le_cmp(&conn->le.dst, &req->addr) != 0) {
3137+
struct bt_keys *keys = bt_keys_find_addr(conn->id, &req->addr);
3138+
3139+
if (keys) {
3140+
if (!update_keys_check(smp, keys)) {
3141+
return BT_SMP_ERR_UNSPECIFIED;
3142+
}
3143+
3144+
bt_keys_clear(keys);
3145+
}
3146+
}
3147+
31363148
if (atomic_test_bit(smp->flags, SMP_FLAG_BOND)) {
31373149
const bt_addr_le_t *dst;
31383150
struct bt_keys *keys;

0 commit comments

Comments
 (0)