From 6c4216094ef4771d1d5011b7aee35f241e3bcc4d Mon Sep 17 00:00:00 2001 From: Kirill Elagin Date: Tue, 27 Apr 2021 20:34:35 +0900 Subject: scd: Fix unblock PIN by a Reset Code with KDF. * scd/app-openpgp.c (do_change_pin): Use correct CHVNO=1 for pin2hash_if_kdf, for user's PIN. -- GnuPG-bug-id: 5413 Signed-off-by: Kirill Elagin (cherry picked from commit f209d7d2db0e963a6ad1fa8c4f0c034ba0297842) --- scd/app-openpgp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 4ac7f5d72..ba54b9a28 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -2924,7 +2924,7 @@ do_change_pin (app_t app, ctrl_t ctrl, const char *chvnostr, if (!rc) { strcpy (buffer+pinlen0, pinvalue); - rc = pin2hash_if_kdf (app, 0, buffer+pinlen0, &pinlen); + rc = pin2hash_if_kdf (app, 1, buffer+pinlen0, &pinlen); } if (!rc) rc = iso7816_reset_retry_counter_with_rc (app->slot, 0x81, -- cgit v1.2.3