From 7e2f5ee0089cb5391e0c2052b3521e3e2d2f2417 Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Thu, 1 Mar 2018 14:25:22 +0000 Subject: [PATCH] fix not setting the mitm performed state correctly --- .../source/generic/GenericSecurityManager.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp b/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp index fe0a15be5c..024e270f69 100644 --- a/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp +++ b/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp @@ -782,7 +782,7 @@ bool GenericSecurityManager::crypto_toolbox_f4( void GenericSecurityManager::set_mitm_performed(connection_handle_t connection, bool enable) { ControlBlock_t *cb = get_control_block(connection); 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_responder_key_distribution(responder_dist); - set_mitm_performed(connection, false); + cb->mitm_performed = false; if (_pairing_authorisation_required) { eventHandler->pairingRequest(connection); @@ -905,11 +905,6 @@ void GenericSecurityManager::on_pairing_completed(connection_handle_t connection if (cb->encryption_requested) { 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