From e100f7c01fc4938f9c2af9b65ba906c9303f5ba6 Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Fri, 19 Jan 2018 16:20:37 +0000 Subject: [PATCH] returning csrk key, init distribution list --- features/FEATURE_BLE/ble/SecurityManager.h | 2 ++ .../source/generic/GenericSecurityManager.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/features/FEATURE_BLE/ble/SecurityManager.h b/features/FEATURE_BLE/ble/SecurityManager.h index a61e21c146..20c144d84c 100644 --- a/features/FEATURE_BLE/ble/SecurityManager.h +++ b/features/FEATURE_BLE/ble/SecurityManager.h @@ -140,7 +140,9 @@ public: } virtual void signingKey(connection_handle_t handle, const csrk_t csrk, bool authenticated) { + (void)handle; (void)csrk; + (void)authenticated; } //////////////////////////////////////////////////////////////////////////// diff --git a/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp b/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp index 3024a17a13..290714c4cd 100644 --- a/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp +++ b/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp @@ -441,8 +441,8 @@ protected: pairing_authorisation_required(false), legacy_pairing_allowed(true), authentication(0), - initiator_dist(0), - responder_dist(0) { + initiator_dist(KeyDistribution::KEY_DISTRIBUTION_ALL), + responder_dist(KeyDistribution::KEY_DISTRIBUTION_ALL) { _app_event_handler = &defaultEventHandler; pal.set_event_handler(this); } @@ -594,6 +594,10 @@ public: irk, csrk ); + + if (_app_event_handler) { + _app_event_handler->signingKey(connection, csrk, db.get_entry(connection)->mitm); + } } void on_keys_distributed_ltk(connection_handle_t connection, @@ -625,6 +629,10 @@ public: void on_keys_distributed_csrk(connection_handle_t connection, const csrk_t csrk) { db.update_entry_csrk(connection, csrk); + + if (_app_event_handler) { + _app_event_handler->signingKey(connection, csrk, db.get_entry(connection)->mitm); + } } void on_ltk_request(connection_handle_t connection,