Cordio PAL Security Manager: Copy locally own IRK.

The IRK needs to be stored somewhere as it is not copied inside the stack, the stack just keeps a reference to it.
pull/6932/head
Vincent Coubard 2018-05-01 11:33:36 +01:00
parent 2924bb4c86
commit e4813f4fe9
2 changed files with 3 additions and 1 deletions

View File

@ -326,6 +326,7 @@ private:
passkey_num_t _default_passkey;
bool _lesc_keys_generated;
uint8_t _public_key_x[SEC_ECC_KEY_LEN];
irk_t _irk;
};
} // cordio

View File

@ -264,7 +264,8 @@ ble_error_t CordioSecurityManager::set_ltk_not_found(
ble_error_t CordioSecurityManager::set_irk(const irk_t& irk)
{
DmSecSetLocalIrk(const_cast<uint8_t*>(irk.data()));
_irk = irk;
DmSecSetLocalIrk(_irk.data());
return BLE_ERROR_NONE;
}