diff --git a/features/FEATURE_BLE/ble/pal/PalSecurityManager.h b/features/FEATURE_BLE/ble/pal/PalSecurityManager.h index d16e64cd23..77b2aa4903 100644 --- a/features/FEATURE_BLE/ble/pal/PalSecurityManager.h +++ b/features/FEATURE_BLE/ble/pal/PalSecurityManager.h @@ -958,12 +958,15 @@ public: * If the verification failed this will not be called and cancel_pairing will be called instead. * * @param[in] connection connection handle + * @param[in] oob_rand_t random number sent from the local device to be used in further + * calculations by the stack, set to 0 if peer reported no OOB present * @param[in] oob_rand_t random number from the peer to be used in further * calculations by the stack, set to 0 if no OOB data received * @retval BLE_ERROR_NONE On success, else an error code indicating reason for failure */ virtual ble_error_t oob_data_verified( connection_handle_t connection, + const oob_rand_t &local_random, const oob_rand_t &peer_random ) = 0; diff --git a/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp b/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp index 2aa0bacaee..6183878bd2 100644 --- a/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp +++ b/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp @@ -641,6 +641,7 @@ void GenericSecurityManager::generate_secure_connections_oob( ) { address_t local_address; oob_confirm_t confirm; + /* @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part H - 2.2.6 */ /*TODO:generate*/ _app_event_handler->oobGenerated(&local_address, &_sc_oob_local_random, &confirm); } @@ -859,7 +860,12 @@ void GenericSecurityManager::on_oob_data_verification_request( const public_key_t &peer_public_key_x, const public_key_t &peer_public_key_y ) { - + /*TODO:verify*/ + if (true) { + _pal.oob_data_verified(connection, _sc_oob_local_random, _sc_oob_peer_random); + } else { + _pal.cancel_pairing(connection, pairing_failure_t::CONFIRM_VALUE_FAILED); + } } ////////////////////////////////////////////////////////////////////////////