1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 11:28:14 +00:00

show ui_callback always (before and after)

This commit is contained in:
Pavol Rusnak 2019-02-18 19:29:25 +01:00
parent 38e92407c7
commit d7e7d8ef27
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -754,8 +754,13 @@ secbool storage_unlock(uint32_t pin)
return secfalse;
}
// Sleep for 2^ctr - 1 seconds before checking the PIN.
uint32_t wait = (1 << ctr) - 1;
if (ui_callback) {
if (sectrue == ui_callback(wait, 0)) {
return secfalse;
}
}
// Sleep for 2^ctr - 1 seconds before checking the PIN.
uint32_t progress;
for (uint32_t rem = wait; rem > 0; rem--) {
for (int i = 0; i < 10; i++) {
@ -772,8 +777,7 @@ secbool storage_unlock(uint32_t pin)
hal_delay(100);
}
}
// Show last frame if we were waiting
if ((wait > 0) && ui_callback) {
if (ui_callback) {
if (sectrue == ui_callback(0, 900)) {
return secfalse;
}