mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 05:28:40 +00:00
legacy: set initialized in storage to false if no mnemonic is present
This commit is contained in:
parent
e630279487
commit
4239e8d551
@ -400,6 +400,12 @@ void config_init(void) {
|
|||||||
storage_init(&protectPinUiCallback, HW_ENTROPY_DATA, HW_ENTROPY_LEN);
|
storage_init(&protectPinUiCallback, HW_ENTROPY_DATA, HW_ENTROPY_LEN);
|
||||||
memzero(HW_ENTROPY_DATA, sizeof(HW_ENTROPY_DATA));
|
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.
|
// Auto-unlock storage if no PIN is set.
|
||||||
if (storage_is_unlocked() == secfalse && storage_has_pin() == secfalse) {
|
if (storage_is_unlocked() == secfalse && storage_has_pin() == secfalse) {
|
||||||
storage_unlock(PIN_EMPTY, NULL);
|
storage_unlock(PIN_EMPTY, NULL);
|
||||||
|
@ -46,8 +46,7 @@ bool get_features(Features *resp) {
|
|||||||
config_getLanguage(resp->language, sizeof(resp->language));
|
config_getLanguage(resp->language, sizeof(resp->language));
|
||||||
resp->has_label = config_getLabel(resp->label, sizeof(resp->label));
|
resp->has_label = config_getLabel(resp->label, sizeof(resp->label));
|
||||||
resp->has_initialized = true;
|
resp->has_initialized = true;
|
||||||
// imported xprv is not supported anymore so we require mnemonic
|
resp->initialized = config_isInitialized();
|
||||||
resp->initialized = config_isInitialized() && config_hasMnemonic();
|
|
||||||
resp->has_imported = config_getImported(&(resp->imported));
|
resp->has_imported = config_getImported(&(resp->imported));
|
||||||
resp->has_pin_cached = true;
|
resp->has_pin_cached = true;
|
||||||
resp->pin_cached = session_isUnlocked() && config_hasPin();
|
resp->pin_cached = session_isUnlocked() && config_hasPin();
|
||||||
|
Loading…
Reference in New Issue
Block a user