1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 03:18:09 +00:00

Before checking the PIN sleep for 2^ctr - 1 seconds instead of 2^(ctr-1) seconds.

This commit is contained in:
Andrew Kozlik 2019-02-14 16:52:35 +01:00
parent 13b256ab2c
commit 94cb1a4dbe

View File

@ -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++) {