mirror of https://github.com/ARMmbed/mbed-os.git
sc oob verification needs local random value
parent
d061c89e31
commit
56530d4917
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue