From 020c5b42626869dc9f87c474ce7546b2abc8d47e Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Thu, 28 Feb 2019 13:32:28 +0000 Subject: [PATCH] BLE - Disabling SecurityManager connection handling when security disabled. --- .../FEATURE_BLE/source/generic/GenericSecurityManager.tpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/features/FEATURE_BLE/source/generic/GenericSecurityManager.tpp b/features/FEATURE_BLE/source/generic/GenericSecurityManager.tpp index f668518b8a..311575a9e3 100644 --- a/features/FEATURE_BLE/source/generic/GenericSecurityManager.tpp +++ b/features/FEATURE_BLE/source/generic/GenericSecurityManager.tpp @@ -1105,6 +1105,7 @@ void GenericSecurityManager::on_connected_( const BLEProtocol::AddressBytes_t local_address, const ::Gap::ConnectionParams_t *connection_params ) { +#if BLE_FEATURE_SECURITY MBED_ASSERT(_db); ControlBlock_t *cb = acquire_control_block(connection); if (!cb) { @@ -1136,7 +1137,8 @@ void GenericSecurityManager::on_connected_( cb->db_entry ); } -#endif +#endif // BLE_FEATURE_SIGNING +#endif // BLE_FEATURE_SECURITY } template class TPalSecurityManager, template class SigningMonitor> @@ -1144,6 +1146,7 @@ void GenericSecurityManager::on_disconnecte connection_handle_t connection, ::Gap::DisconnectionReason_t reason ) { +#if BLE_FEATURE_SECURITY MBED_ASSERT(_db); ControlBlock_t *cb = get_control_block(connection); if (!cb) { @@ -1155,6 +1158,7 @@ void GenericSecurityManager::on_disconnecte _db->close_entry(cb->db_entry); release_control_block(cb); +#endif // BLE_FEATURE_SECURITY } template class TPalSecurityManager, template class SigningMonitor>