From 2c478166866ed544cbe934135bf49562afd97f4b Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Tue, 26 Apr 2022 16:38:50 +0200 Subject: [PATCH] Fix logging in with PW 82. Signed-off-by: Pol Henarejos --- src/openpgp/openpgp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openpgp/openpgp.c b/src/openpgp/openpgp.c index 2618e0e..285f841 100644 --- a/src/openpgp/openpgp.c +++ b/src/openpgp/openpgp.c @@ -687,7 +687,7 @@ int check_pin(const file_t *pin, const uint8_t *data, size_t len) { return SW_REFERENCE_NOT_FOUND(); } isUserAuthenticated = false; - has_pw1 = has_pw3 = false; + //has_pw1 = has_pw3 = false; uint8_t dhash[32]; 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(); isUserAuthenticated = true; if (pin->fid == EF_PW1) { - if (P1(apdu) == 0x0) + if (P2(apdu) == 0x81) has_pw1 = true; else has_pw2 = true;