mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-18 11:21:11 +00:00
feat(core): Show PIN initialization progress when Optiga throttling delays are active
This commit is contained in:
parent
9420b38a35
commit
a4cf0b2c72
@ -20,6 +20,9 @@ from trezor.ui.layouts.homescreen import Lockscreen
|
||||
|
||||
from apps.common.request_pin import can_lock_device, verify_user_pin
|
||||
|
||||
if utils.USE_OPTIGA:
|
||||
from trezor.crypto import optiga
|
||||
|
||||
# have to use "==" over "in (list)" so that it can be statically replaced
|
||||
# with the correct value during the build process
|
||||
# pylint: disable-next=consider-using-in
|
||||
@ -68,6 +71,8 @@ async def bootscreen() -> None:
|
||||
allow_all_loader_messages()
|
||||
return
|
||||
else:
|
||||
# Even if PIN is not configured, storage needs to be unlocked, unless it has just been initialized.
|
||||
if not config.is_unlocked():
|
||||
await verify_user_pin()
|
||||
storage.init_unlocked()
|
||||
enforce_welcome_screen_duration()
|
||||
@ -94,7 +99,8 @@ async def bootscreen() -> None:
|
||||
utils.halt(e.__class__.__name__)
|
||||
|
||||
|
||||
# Ignoring all non-PIN messages in the boot-phase (turned off in `bootscreen()`).
|
||||
# Ignore all automated PIN messages in the boot-phase (turned off in `bootscreen()`), unless Optiga throttling delays are active.
|
||||
if not utils.USE_OPTIGA or (optiga.get_sec() or 0) < 150:
|
||||
ignore_nonpin_loader_messages()
|
||||
|
||||
config.init(show_pin_timeout)
|
||||
|
@ -779,7 +779,11 @@ static void init_wiped_storage(void) {
|
||||
"set_wipe_code failed");
|
||||
|
||||
ui_progress_init(STORAGE_PIN_OP_SET);
|
||||
if (ui_message == NO_MSG) {
|
||||
ui_message = STARTING_MSG;
|
||||
} else {
|
||||
ui_message = PROCESSING_MSG;
|
||||
}
|
||||
ensure(set_pin(PIN_EMPTY, PIN_EMPTY_LEN, NULL), "init_pin failed");
|
||||
ui_progress_finish();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user