diff --git a/storage.c b/storage.c index 8d8c0e3b7..61cd9fae8 100644 --- a/storage.c +++ b/storage.c @@ -517,7 +517,7 @@ static secbool pin_fails_reset(void) return pin_logs_init(0); } -static secbool pin_fails_increase(void) +secbool storage_pin_fails_increase(void) { const void *logs = NULL; uint16_t len = 0; @@ -739,7 +739,7 @@ secbool storage_unlock(uint32_t pin) // First, we increase PIN fail counter in storage, even before checking the // PIN. If the PIN is correct, we reset the counter afterwards. If not, we // check if this is the last allowed attempt. - if (sectrue != pin_fails_increase()) { + if (sectrue != storage_pin_fails_increase()) { memzero(&pin, sizeof(pin)); return secfalse; } @@ -994,7 +994,7 @@ static void handle_fault(void) ensure(secfalse, "fault detected"); } - if (sectrue != pin_fails_increase()) { + if (sectrue != storage_pin_fails_increase()) { storage_wipe(); ensure(secfalse, "fault detected"); } diff --git a/storage.h b/storage.h index db3b05177..b6c8762b9 100644 --- a/storage.h +++ b/storage.h @@ -31,6 +31,7 @@ void storage_wipe(void); void storage_lock(void); secbool storage_unlock(const uint32_t pin); secbool storage_has_pin(void); +secbool storage_pin_fails_increase(void); uint32_t storage_get_pin_rem(void); secbool storage_change_pin(const uint32_t oldpin, const uint32_t newpin); secbool storage_get(const uint16_t key, void *val, const uint16_t max_len, uint16_t *len);