mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #24 from paul-szczepanek-arm/slave-request
enable encryption for slave request addedpull/6932/head
commit
f6f3d24652
|
@ -853,16 +853,23 @@ void GenericSecurityManager::on_slave_security_request(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authentication.get_secure_connections()
|
bool pairing_required = false;
|
||||||
&& _default_authentication.get_secure_connections()
|
|
||||||
&& !cb->secure_connections_paired) {
|
if (authentication.get_secure_connections() && !cb->secure_connections_paired
|
||||||
requestPairing(connection);
|
&& _default_authentication.get_secure_connections()) {
|
||||||
|
pairing_required = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authentication.get_mitm()
|
if (authentication.get_mitm() && !cb->ltk_mitm_protected) {
|
||||||
&& !cb->ltk_mitm_protected) {
|
pairing_required = true;
|
||||||
cb->mitm_requested = true;
|
cb->mitm_requested = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pairing_required) {
|
||||||
requestPairing(connection);
|
requestPairing(connection);
|
||||||
|
} else if (!cb->encryption_requested) {
|
||||||
|
/* this will refresh keys if encryption is already present */
|
||||||
|
enable_encryption(connection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue