mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Lookup for non identity addresses when a secure entry is opened.
A peer may not share a valid IRK and identity address during pairing (in that case the identity address received is all zeros). When this happens, the entry must be retrieved by looking at the address used by the peer during the connection.pull/6932/head
parent
c4b78ada0e
commit
1e277bad50
|
@ -276,8 +276,16 @@ public:
|
|||
for (size_t i = 0; i < MAX_ENTRIES; i++) {
|
||||
if (_entries[i].state == ENTRY_FREE) {
|
||||
continue;
|
||||
} else if (peer_address == _entries[i].peer_identity.identity_address
|
||||
&& _entries[i].flags.peer_address_is_public == peer_address_public) {
|
||||
} else if (
|
||||
peer_address == _entries[i].peer_identity.identity_address &&
|
||||
peer_address_public ==_entries[i].flags.peer_address_is_public
|
||||
) {
|
||||
return &_entries[i];
|
||||
} else if (
|
||||
_entries[i].peer_identity.identity_address == address_t() &&
|
||||
peer_address == _entries[i].flags.peer_address &&
|
||||
peer_address_public == _entries[i].flags.peer_address_is_public
|
||||
) {
|
||||
return &_entries[i];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue