Skip to content

Conversation

@paul-szczepanek-arm
Copy link
Member

Summary of changes

Add configuration for host privacy feature.

Impact of changes

Migration actions required

Documentation

none


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[x] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@paul-szczepanek-arm paul-szczepanek-arm changed the base branch from master to feature-ble-host-privacy September 24, 2020 16:37
@ciarmcom ciarmcom requested a review from a team September 24, 2020 17:00
@ciarmcom
Copy link
Member

@paul-szczepanek-arm, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@paul-szczepanek-arm paul-szczepanek-arm force-pushed the host-privacy-feature branch 2 times, most recently from fbd3de8 to 3b97267 Compare September 25, 2020 10:14
pan-
pan- previously requested changes Sep 28, 2020
Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Paul, the changes looks good however I question if we shouldn't have a single compile time flag that indicates what type of privacy should be used. I'm thinking of three case:

  • When it is determined at runtime based on controller capabilities.
  • Host based, removing all controller based privacy support
  • Controller based removing host based privacy support except for address generation.

Another option is to set the right privacy configuration in the target configuration.

"ble-gap-host-privacy-resolving-list-size": {
"help": "Used for host privacy. How many pairs of resolvable private addresses and identity address to store.",
"value": 8,
"macro_name": "BLE_GAP_HOST_PRIVACY_RESOLVED_LIST_SIZE"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would made sense for it to be equal to BLE_SECURITY_DATABASE_MAX_ENTRIES There won't be more entries than there is in the security DB.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced with BLE_SECURITY_DATABASE_MAX_ENTRIES

{
#if (BLE_GAP_HOST_BASED_PRIVACY == 0)
/* we need either privacy on host or controller to enable it */
if (enable && !_address_registry.is_controller_privacy_supported()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we check for enable if host base privacy is not enabled ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

narrowed down the meaning to address resolution and fixed ifdefs accordingly

#endif // BLE_ROLE_OBSERVER
}

#if BLE_GAP_HOST_BASED_PRIVACY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be return early or execute the body ? Computations above are pointless if host base privacy is enabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

narrowed down the meaning to address resolution and fixed ifdefs accordingly

},
"ble-gap-host-based-privacy": {
"help": "Perform address resolution on the host, not the controller. Controller based privacy is preferred as it happens lower down the stack but this can be used in case controller based privacy is unavailable. If this is enabled the controller will not be used for privacy.",
"value": false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect this value to be on by default.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to true

bool PrivateAddressController::is_controller_privacy_supported()
{
#if BLE_GAP_HOST_BASED_PRIVACY
return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is accurate host based privacy may be enabled on a board with LL privacy available.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

narrowed down the meaning to address resolution and fixed ifdefs accordingly

@mergify mergify bot dismissed pan-’s stale review September 28, 2020 09:22

Pull request has been modified.

@mergify
Copy link

mergify bot commented Sep 28, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

}
}
#else
if (!apply_peripheral_privacy_connection_policy(event)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will cause an issue if BLE_FEATURE_PRIVACY is not set as apply_peripheral_privacy_connection_policy won't be available.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@pan- pan- merged commit 2f283e2 into ARMmbed:feature-ble-host-privacy Sep 29, 2020
@pan- pan- mentioned this pull request Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants