-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature ble host privacy #13717
Feature ble host privacy #13717
Conversation
This PAL interface is responsible for generating, resolving private address and maintaining the controller or host resolving list. It also indicates to upper level if LL resolution is supported or not and allows them to enable it.
It controls private address generation and host or controller address resolution.
Resolution list has been removed from the pal as this is handled by the PrivateAddressController.
A race condition was present if a single event was present in the event queue and the event was generating a new event.
…to connect to a peer.
enabling/disabling scanning and advertising operations can be prevented if the previous operations hasn't completed. Return that the stack is busy and cannot fulfill the request at the moment rather than the state is invalid.
…platform. The function to get it has been removed as this operation is driven by the security manager.
This also ensure the random static address used by gap is the correct one.
@alexherriott-dmc You should start advertising when the privacy has been enabled. You receive that event through
|
@pan- thanks for that, that seems to work then. I'm still testing bonding for #13499, it works on the iOS test device. I will let you know if the Android devices also work. Another thing I have noticed, |
@alexherriott-dmc In the case you described, the connection event should not be passed to the application, the system should take care of disconnecting the peer. Is it what you are observing ? |
if (_connect_to_host_resolved_address_state == ConnectionToHostResolvedAddressState::scan) { | ||
return BLE_ERROR_OPERATION_NOT_PERMITTED; | ||
} | ||
#endif BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#endif //BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION
The connection event reported by the WB55 is incorrect if controller privacy is not enable and the peer connects with an unknown private resolvable address: The RPA field contains the connection address (it should be empty) and the peer address is all FF while it should be equal to the connection address.
Privacy workaround wb55
Fix conditional compilation for ble
@0xc0170 We consider that PR ready, anything you would like from us ? |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
This PR reimplements Bluetooth privacy for all type of Bluetooth controllers (4.0 to 5.2).
As soon as privacy is enabled, a private address is used to advertise, scan or initiate connection and peers resolvable addresses are resolved if a bond with matching IRK is found in the security database.
This should solve most of the pairing issues observed on Android and iOS where the local device is not able to retrieve a previous bond.
Internally there is two implementations of the address resolution:
New configurations flags have been added to select at compile time the implementation to use:
ble-gap-host-based-private-address-resolution
Forces the system to use host based resolutionble-gap-host-privacy-resolved-cache-size
Indicate how many entries must be booked for the host based resolution cache.This PR is the result of the following PRs merged on the feature branch
Impact of changes
Existing applications should not have anything to change regards to calls to privacy APIs as this PR enables it for all type of controllers and not just resolution when supported by the hardware.
The advertising state was showing up as enabled as soon as the function
startAdvertising
was called. This is was not correct as it wasn't reflecting the reality of operations. The state is now modified when advertising is actually active. Two new events have been added toGap::EventHandler
to catch the change of advertising state.Migration actions required
Documentation
None
Pull request type
Test results
privacy-tests.zip
Reviewers