mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-18 02:22:01 +00:00
storage: unlock storage after wipe
This commit is contained in:
parent
c16194115d
commit
252d069a66
@ -642,9 +642,7 @@ static void init_wiped_storage(void) {
|
|||||||
ui_rem = ui_total;
|
ui_rem = ui_total;
|
||||||
ui_message = PROCESSING_MSG;
|
ui_message = PROCESSING_MSG;
|
||||||
ensure(set_pin(PIN_EMPTY, NULL), "init_pin failed");
|
ensure(set_pin(PIN_EMPTY, NULL), "init_pin failed");
|
||||||
if (unlocked != sectrue) {
|
unlocked = sectrue;
|
||||||
memzero(cached_keys, sizeof(cached_keys));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void storage_init(PIN_UI_WAIT_CALLBACK callback, const uint8_t *salt,
|
void storage_init(PIN_UI_WAIT_CALLBACK callback, const uint8_t *salt,
|
||||||
@ -669,6 +667,7 @@ void storage_init(PIN_UI_WAIT_CALLBACK callback, const uint8_t *salt,
|
|||||||
uint16_t len = 0;
|
uint16_t len = 0;
|
||||||
if (secfalse == norcow_get(EDEK_PVC_KEY, &val, &len)) {
|
if (secfalse == norcow_get(EDEK_PVC_KEY, &val, &len)) {
|
||||||
init_wiped_storage();
|
init_wiped_storage();
|
||||||
|
storage_lock();
|
||||||
}
|
}
|
||||||
memzero(cached_keys, sizeof(cached_keys));
|
memzero(cached_keys, sizeof(cached_keys));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user