From 0e897f673a2150607bae553e21604b253352644e Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Fri, 22 Feb 2019 19:04:14 +0100 Subject: [PATCH] In unlock() show 'Processing' instead of 'Verifying PIN' if the PIN is empty. --- storage.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/storage.c b/storage.c index 4454084464..0f1df28624 100644 --- a/storage.c +++ b/storage.c @@ -780,9 +780,11 @@ secbool storage_unlock(uint32_t pin) return secfalse; } + const char* message = (pin == PIN_EMPTY) ? PROCESSING_MSG : VERIFYING_PIN_MSG; + uint32_t wait = (1 << ctr) - 1; if (ui_callback) { - if (sectrue == ui_callback(wait, 0, VERIFYING_PIN_MSG)) { + if (sectrue == ui_callback(wait, 0, message)) { return secfalse; } } @@ -796,7 +798,7 @@ secbool storage_unlock(uint32_t pin) } else { progress = ((wait - rem) * 10 + i) * 80 / wait; } - if (sectrue == ui_callback(rem, progress, VERIFYING_PIN_MSG)) { + if (sectrue == ui_callback(rem, progress, message)) { return secfalse; } } @@ -804,7 +806,7 @@ secbool storage_unlock(uint32_t pin) } } if (ui_callback) { - if (sectrue == ui_callback(0, 800, VERIFYING_PIN_MSG)) { + if (sectrue == ui_callback(0, 800, message)) { return secfalse; } }