1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 20:19:23 +00:00

feat(core/ble): randomize BLE MAC address

[no changelog]
This commit is contained in:
tychovrahe 2023-04-11 13:11:54 +02:00
parent fa98e17f6b
commit 2cb681f334

View File

@ -787,6 +787,7 @@ static void pm_evt_handler(pm_evt_t const *p_evt) {
*/
static void peer_manager_init(void) {
ble_gap_sec_params_t sec_param;
pm_privacy_params_t privacy_params;
ret_code_t err_code;
err_code = pm_init();
@ -811,6 +812,13 @@ static void peer_manager_init(void) {
err_code = pm_sec_params_set(&sec_param);
APP_ERROR_CHECK(err_code);
privacy_params.p_device_irk = NULL;
privacy_params.privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY;
privacy_params.private_addr_cycle_s = 0;
privacy_params.private_addr_type =
BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
pm_privacy_set(&privacy_params);
err_code = pm_register(pm_evt_handler);
APP_ERROR_CHECK(err_code);
}