Fix logging in with PW 82.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-04-26 16:38:50 +02:00
parent b0b30aff3a
commit 2c47816686

View File

@@ -687,7 +687,7 @@ int check_pin(const file_t *pin, const uint8_t *data, size_t len) {
return SW_REFERENCE_NOT_FOUND(); return SW_REFERENCE_NOT_FOUND();
} }
isUserAuthenticated = false; isUserAuthenticated = false;
has_pw1 = has_pw3 = false; //has_pw1 = has_pw3 = false;
uint8_t dhash[32]; uint8_t dhash[32];
double_hash_pin(data, len, dhash); double_hash_pin(data, len, dhash);
@@ -707,7 +707,7 @@ int check_pin(const file_t *pin, const uint8_t *data, size_t len) {
return SW_MEMORY_FAILURE(); return SW_MEMORY_FAILURE();
isUserAuthenticated = true; isUserAuthenticated = true;
if (pin->fid == EF_PW1) { if (pin->fid == EF_PW1) {
if (P1(apdu) == 0x0) if (P2(apdu) == 0x81)
has_pw1 = true; has_pw1 = true;
else else
has_pw2 = true; has_pw2 = true;