storage: fix unlock

This commit is contained in:
Jan Pochyla 2017-11-06 17:26:13 +01:00
parent 5444410e04
commit df77e74988
1 changed files with 6 additions and 1 deletions

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)