1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-26 16:18:22 +00:00

storage: unlock storage after wipe

This commit is contained in:
Tomas Susanka 2019-12-04 14:23:15 +00:00
parent c16194115d
commit 252d069a66

View File

@ -642,9 +642,7 @@ static void init_wiped_storage(void) {
ui_rem = ui_total;
ui_message = PROCESSING_MSG;
ensure(set_pin(PIN_EMPTY, NULL), "init_pin failed");
if (unlocked != sectrue) {
memzero(cached_keys, sizeof(cached_keys));
}
unlocked = sectrue;
}
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;
if (secfalse == norcow_get(EDEK_PVC_KEY, &val, &len)) {
init_wiped_storage();
storage_lock();
}
memzero(cached_keys, sizeof(cached_keys));
}