From c36a8d7dba1a16b32479cc3fbc0e5fcd8c01c29a Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Thu, 29 Mar 2018 15:24:40 +0100 Subject: [PATCH] let the stack know whether csrk is authenticated --- features/FEATURE_BLE/ble/pal/PalSecurityManager.h | 3 ++- .../FEATURE_BLE/source/generic/GenericSecurityManager.cpp | 5 ++++- .../targets/TARGET_CORDIO/CordioPalSecurityManager.h | 3 ++- .../TARGET_CORDIO/source/CordioPalSecurityManager.cpp | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/features/FEATURE_BLE/ble/pal/PalSecurityManager.h b/features/FEATURE_BLE/ble/pal/PalSecurityManager.h index 875f0d0e85..05f624e5c5 100644 --- a/features/FEATURE_BLE/ble/pal/PalSecurityManager.h +++ b/features/FEATURE_BLE/ble/pal/PalSecurityManager.h @@ -885,7 +885,8 @@ public: */ virtual ble_error_t set_peer_csrk( connection_handle_t connection, - const csrk_t &csrk + const csrk_t &csrk, + bool authenticated ) = 0; //////////////////////////////////////////////////////////////////////////// diff --git a/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp b/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp index ff14a5b6e2..a41035e474 100644 --- a/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp +++ b/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp @@ -711,7 +711,10 @@ void GenericSecurityManager::set_peer_csrk_cb( return; } - _pal.set_peer_csrk(cb->connection, *csrk); + _pal.set_peer_csrk( + cb->connection, + *csrk, + cb->csrk_mitm_protected); } void GenericSecurityManager::return_csrk_cb( diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h index dbc4346725..564ecf9856 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h @@ -244,7 +244,8 @@ public: */ virtual ble_error_t set_peer_csrk( connection_handle_t connection, - const csrk_t &csrk + const csrk_t &csrk, + bool authenticated ); //////////////////////////////////////////////////////////////////////////// diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.cpp index c5a1c15811..df1b55b652 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.cpp @@ -274,7 +274,8 @@ ble_error_t CordioSecurityManager::set_csrk(const csrk_t& csrk) ble_error_t CordioSecurityManager::set_peer_csrk( connection_handle_t connection, - const csrk_t &csrk + const csrk_t &csrk, + bool authenticated ) { /* TODO implement */ return BLE_ERROR_NOT_IMPLEMENTED;