From 94cb1a4dbe2e28aaaf36cd741800cf5c1b16e08f Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Thu, 14 Feb 2019 16:52:35 +0100 Subject: [PATCH] Before checking the PIN sleep for 2^ctr - 1 seconds instead of 2^(ctr-1) seconds. --- storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage.c b/storage.c index 16ebe6597f..2611f7cf7c 100644 --- a/storage.c +++ b/storage.c @@ -744,8 +744,8 @@ secbool storage_unlock(uint32_t pin) return secfalse; } - // Sleep for 2^(ctr-1) seconds before checking the PIN. - uint32_t wait = (1 << ctr) >> 1; + // Sleep for 2^ctr - 1 seconds before checking the PIN. + uint32_t wait = (1 << ctr) - 1; uint32_t progress; for (uint32_t rem = wait; rem > 0; rem--) { for (int i = 0; i < 10; i++) {