ble - Generic Security Manager: set signing unconditionnal to role reversal.

A peripheral can act as a GATT client whether it is in the peripheral role or the central role therefore it doesn't make sense to enable signing only if roles will be reversed latter.
pull/6932/head
Vincent Coubard 2018-05-01 11:50:59 +01:00
parent 9880db7543
commit 1ac95e105b
1 changed files with 6 additions and 4 deletions

View File

@ -139,14 +139,16 @@ ble_error_t GenericSecurityManager::requestPairing(connection_handle_t connectio
_default_key_distribution.get_link()
);
initiator_distribution.set_signing(
cb->signing_override_default ?
cb->signing_requested :
_default_key_distribution.get_signing()
);
/* if requested the initiator may send all the default keys for later
* use when roles are changed */
if (_master_sends_keys) {
initiator_distribution = _default_key_distribution;
/* override default if requested */
if (cb->signing_override_default) {
initiator_distribution.set_signing(cb->signing_requested);
}
}
KeyDistribution responder_distribution(_default_key_distribution);