mirror of https://github.com/ARMmbed/mbed-os.git
fix not setting the mitm performed state correctly
parent
bc11834125
commit
7e2f5ee008
|
@ -782,7 +782,7 @@ bool GenericSecurityManager::crypto_toolbox_f4(
|
||||||
void GenericSecurityManager::set_mitm_performed(connection_handle_t connection, bool enable) {
|
void GenericSecurityManager::set_mitm_performed(connection_handle_t connection, bool enable) {
|
||||||
ControlBlock_t *cb = get_control_block(connection);
|
ControlBlock_t *cb = get_control_block(connection);
|
||||||
if (cb) {
|
if (cb) {
|
||||||
cb->mitm_performed = true;
|
cb->mitm_performed = enable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -859,7 +859,7 @@ void GenericSecurityManager::on_pairing_request(
|
||||||
cb->set_initiator_key_distribution(initiator_dist);
|
cb->set_initiator_key_distribution(initiator_dist);
|
||||||
cb->set_responder_key_distribution(responder_dist);
|
cb->set_responder_key_distribution(responder_dist);
|
||||||
|
|
||||||
set_mitm_performed(connection, false);
|
cb->mitm_performed = false;
|
||||||
|
|
||||||
if (_pairing_authorisation_required) {
|
if (_pairing_authorisation_required) {
|
||||||
eventHandler->pairingRequest(connection);
|
eventHandler->pairingRequest(connection);
|
||||||
|
@ -905,11 +905,6 @@ void GenericSecurityManager::on_pairing_completed(connection_handle_t connection
|
||||||
if (cb->encryption_requested) {
|
if (cb->encryption_requested) {
|
||||||
enable_encryption(connection);
|
enable_encryption(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sc doesn't need to exchange ltk */
|
|
||||||
if (cb->secure_connections_paired) {
|
|
||||||
cb->ltk_mitm_protected = cb->mitm_performed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the distribution flags in the db
|
// set the distribution flags in the db
|
||||||
|
|
Loading…
Reference in New Issue