From 252d069a66eafaa434aae433114f1713aff003a5 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Wed, 4 Dec 2019 14:23:15 +0000 Subject: [PATCH] storage: unlock storage after wipe --- storage/storage.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/storage/storage.c b/storage/storage.c index 2e98458357..2e973d91bb 100644 --- a/storage/storage.c +++ b/storage/storage.c @@ -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)); }