You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Harden BLE pairing and actually revoke removed phones #9
Revocation doesn't work. On ESP, RemovePairedPhone / ClearPairedPhones
(boards/esp/src/lib.rs:80) only edit the in-memory PAIRED_PHONES list,
which nothing on ESP uses for authorization. The real credentials (LTKs in BondStore flash plus the controller filter-accept/resolving lists) are
untouched, so a removed phone still connects. Remove the bond via stack.remove_bond_information, BondStore::remove_bond and remove_bond_from_controller (all exist in ble/transport.rs), and drop the
separate registry or make it the source of truth.
Auto-heal is too aggressive.ble/transport.rs:521 treats REMOTE_USER_TERMINATED_CONN (a normal phone disconnect) as a security
failure, so any disconnect during the pairing window wipes that phone's bond.
max_bonded_phones isn't enforced on BLE bonds (the store is hard-capped at 8).
Later: LTKs are stored unencrypted in flash (flash encryption).
Status after #45 (closes #17), tested on a WiCAN with one Android phone (Pixel). The PR description has the full list.
Verified on hardware: removing or clearing while connected revokes the bond and disconnects the phone, and that survives a reboot. A normal hang-up after an encrypted session keeps the bond. Remove / Clear are refused with the window closed. Stale-bond recovery (the board still has the bond, the phone forgot it) needed one more change: Android reports it as a normal hang-up before the link encrypts, so a hang-up now counts as a broken bond only if the link never got encrypted.
Not verified yet:
With a second device: removing a phone that isn't connected (the path between connections in the advertise loop), removing one bond while another stays, and refusing a new phone once max_bonded_phones is reached.
iOS / unresolved random addresses. Recognising a known phone at connect also accepts match_address, but two other checks compare the bond's identity address with peer_identity().bd_addr directly: whether a removed phone is the connected one (hits_peer in gatt_event_task), and the auto-heal lookup. If a phone ever shows up with an address the controller didn't resolve, Remove would revoke the bond without disconnecting it, and auto-heal wouldn't find the bond. The Pixel always reconnected with its identity address, so this wasn't exercised.
Also open: on ESP, ListPairedPhones only writes a debug log line and never replies, so the app can't show the paired phones yet.
Activity
Tichael commentedon Oct 22, 2026
Status after #45 (closes #17), tested on a WiCAN with one Android phone (Pixel). The PR description has the full list.
Verified on hardware: removing or clearing while connected revokes the bond and disconnects the phone, and that survives a reboot. A normal hang-up after an encrypted session keeps the bond. Remove / Clear are refused with the window closed. Stale-bond recovery (the board still has the bond, the phone forgot it) needed one more change: Android reports it as a normal hang-up before the link encrypts, so a hang-up now counts as a broken bond only if the link never got encrypted.
Not verified yet:
max_bonded_phonesis reached.match_address, but two other checks compare the bond's identity address withpeer_identity().bd_addrdirectly: whether a removed phone is the connected one (hits_peeringatt_event_task), and the auto-heal lookup. If a phone ever shows up with an address the controller didn't resolve, Remove would revoke the bond without disconnecting it, and auto-heal wouldn't find the bond. The Pixel always reconnected with its identity address, so this wasn't exercised.Also open: on ESP,
ListPairedPhonesonly writes a debug log line and never replies, so the app can't show the paired phones yet.