Call reset puk store on init.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2023-03-07 11:14:42 +01:00
parent 63b245b858
commit fb4ff9424e
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -218,11 +218,7 @@ int puk_store_select_chr(const uint8_t *chr) {
return CCID_ERR_FILE_NOT_FOUND;
}
void init_sc_hsm() {
scan_all();
has_session_pin = has_session_sopin = false;
isUserAuthenticated = false;
cmd_select();
void reset_puk_store() {
if (puk_store_entries > 0) { /* From previous session */
for (int i = 0; i < puk_store_entries; i++) {
if (puk_store[i].copied == true) {
@ -251,6 +247,14 @@ void init_sc_hsm() {
memset(puk_status, 0, sizeof(puk_status));
}
void init_sc_hsm() {
scan_all();
has_session_pin = has_session_sopin = false;
isUserAuthenticated = false;
cmd_select();
reset_puk_store();
}
int sc_hsm_unload() {
has_session_pin = has_session_sopin = false;
isUserAuthenticated = false;