From 4239e8d551644fd90f4cb4af6a1d833c8bf03f91 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Thu, 18 Jun 2020 20:13:56 +0200 Subject: [PATCH] legacy: set initialized in storage to false if no mnemonic is present --- legacy/firmware/config.c | 6 ++++++ legacy/firmware/fsm_msg_common.h | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/legacy/firmware/config.c b/legacy/firmware/config.c index a7eac1932..787e3c499 100644 --- a/legacy/firmware/config.c +++ b/legacy/firmware/config.c @@ -400,6 +400,12 @@ void config_init(void) { storage_init(&protectPinUiCallback, HW_ENTROPY_DATA, HW_ENTROPY_LEN); memzero(HW_ENTROPY_DATA, sizeof(HW_ENTROPY_DATA)); + // imported xprv is not supported anymore so we set initialized to false + // if no mnemonic is present + if (config_isInitialized() && !config_hasMnemonic()) { + config_set_bool(KEY_INITIALIZED, false); + } + // Auto-unlock storage if no PIN is set. if (storage_is_unlocked() == secfalse && storage_has_pin() == secfalse) { storage_unlock(PIN_EMPTY, NULL); diff --git a/legacy/firmware/fsm_msg_common.h b/legacy/firmware/fsm_msg_common.h index 3a5facad3..32b959417 100644 --- a/legacy/firmware/fsm_msg_common.h +++ b/legacy/firmware/fsm_msg_common.h @@ -46,8 +46,7 @@ bool get_features(Features *resp) { config_getLanguage(resp->language, sizeof(resp->language)); resp->has_label = config_getLabel(resp->label, sizeof(resp->label)); resp->has_initialized = true; - // imported xprv is not supported anymore so we require mnemonic - resp->initialized = config_isInitialized() && config_hasMnemonic(); + resp->initialized = config_isInitialized(); resp->has_imported = config_getImported(&(resp->imported)); resp->has_pin_cached = true; resp->pin_cached = session_isUnlocked() && config_hasPin();