1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-19 12:58:13 +00:00

storage: fix unlock

This commit is contained in:
Jan Pochyla 2017-11-06 17:26:13 +01:00
parent 5444410e04
commit df77e74988

View File

@ -130,6 +130,8 @@ secbool storage_unlock(const uint8_t *pin, size_t len)
return secfalse;
}
unlocked = secfalse;
uint32_t ofs;
uint32_t ctr;
if (sectrue != pin_fails_read(&ofs, &ctr)) {
@ -153,7 +155,10 @@ secbool storage_unlock(const uint8_t *pin, size_t len)
return secfalse;
}
pin_fails_reset(ofs);
return sectrue;
unlocked = sectrue;
return unlocked;
}
secbool storage_get(uint16_t key, const void **val, uint16_t *len)