From a31d1012db51c51ef76e2dca6e1279b96f1531e4 Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Thu, 28 Feb 2019 11:36:36 +0000 Subject: [PATCH] BLE - Cleanup CordioPalSecurityManager conditional directives. - Within constructor - Within member declaration - Private function declaration and definition. --- .../TARGET_CORDIO/CordioPalSecurityManager.h | 8 +------- .../source/CordioPalSecurityManager.tpp | 14 ++------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h index 41e1ca97d0..423ab7cf6b 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h @@ -238,7 +238,6 @@ public: */ ble_error_t set_irk_(const irk_t &irk); -#if BLE_FEATURE_SIGNING /** * @see ::ble::pal::SecurityManager::set_csrk */ @@ -258,7 +257,6 @@ public: ); ble_error_t remove_peer_csrk_(connection_handle_t connection); -#endif // BLE_FEATURE_SIGNING //////////////////////////////////////////////////////////////////////////// // Authentication @@ -363,10 +361,8 @@ private: // Try to dequeue and process the next control block // cb_completed is set when the previous block has completed void process_privacy_control_blocks(bool cb_completed); - -#if BLE_FEATURE_SIGNING + void cleanup_peer_csrks(); -#endif bool _use_default_passkey; passkey_num_t _default_passkey; @@ -377,10 +373,8 @@ private: bool _processing_privacy_control_block; irk_t _irk; -#if BLE_FEATURE_SIGNING csrk_t _csrk; csrk_t* _peer_csrks[DM_CONN_MAX]; -#endif // BLE_FEATURE_SIGNING }; } // cordio diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.tpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.tpp index d07f5e2a9f..ef0cd20147 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.tpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.tpp @@ -16,8 +16,6 @@ #include "BLERoles.h" -#if BLE_FEATURE_SECURITY - #include #include "CordioPalSecurityManager.h" @@ -39,10 +37,8 @@ CordioSecurityManager::CordioSecurityManager() : _lesc_keys_generated(false), _public_key_x(), _pending_privacy_control_blocks(NULL), - _processing_privacy_control_block(false) -#if BLE_FEATURE_SIGNING - , _peer_csrks() -#endif + _processing_privacy_control_block(false), + _peer_csrks() { } @@ -332,7 +328,6 @@ ble_error_t CordioSecurityManager::set_irk_(const irk_t& irk) return BLE_ERROR_NONE; } -#if BLE_FEATURE_SIGNING template ble_error_t CordioSecurityManager::set_csrk_( const csrk_t& csrk, @@ -390,7 +385,6 @@ ble_error_t CordioSecurityManager::remove_peer_csrk_(connection_ha AttsSetCsrk(connection, NULL, false); return BLE_ERROR_NONE; } -#endif // BLE_FEATURE_SIGNING //////////////////////////////////////////////////////////////////////////// // Global parameters @@ -1011,7 +1005,6 @@ void CordioSecurityManager::process_privacy_control_blocks(bool cb _pending_privacy_control_blocks = next; } -#if BLE_FEATURE_SIGNING template void CordioSecurityManager::cleanup_peer_csrks() { for (size_t i = 0; i < DM_CONN_MAX; ++i) { @@ -1021,11 +1014,8 @@ void CordioSecurityManager::cleanup_peer_csrks() { } } } -#endif // BLE_FEATURE_SIGNING } // cordio } // vendor } // pal } // ble - -#endif // BLE_FEATURE_SECURITY