Skip to content

Commit 7e2f5ee

Browse files
fix not setting the mitm performed state correctly
1 parent bc11834 commit 7e2f5ee

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ bool GenericSecurityManager::crypto_toolbox_f4(
782782
void GenericSecurityManager::set_mitm_performed(connection_handle_t connection, bool enable) {
783783
ControlBlock_t *cb = get_control_block(connection);
784784
if (cb) {
785-
cb->mitm_performed = true;
785+
cb->mitm_performed = enable;
786786
}
787787
}
788788

@@ -859,7 +859,7 @@ void GenericSecurityManager::on_pairing_request(
859859
cb->set_initiator_key_distribution(initiator_dist);
860860
cb->set_responder_key_distribution(responder_dist);
861861

862-
set_mitm_performed(connection, false);
862+
cb->mitm_performed = false;
863863

864864
if (_pairing_authorisation_required) {
865865
eventHandler->pairingRequest(connection);
@@ -905,11 +905,6 @@ void GenericSecurityManager::on_pairing_completed(connection_handle_t connection
905905
if (cb->encryption_requested) {
906906
enable_encryption(connection);
907907
}
908-
909-
/* sc doesn't need to exchange ltk */
910-
if (cb->secure_connections_paired) {
911-
cb->ltk_mitm_protected = cb->mitm_performed;
912-
}
913908
}
914909

915910
// set the distribution flags in the db

0 commit comments

Comments
 (0)