From f209d7d2db0e963a6ad1fa8c4f0c034ba0297842 Mon Sep 17 00:00:00 2001 From: Kirill Elagin Date: Tue, 27 Apr 2021 20:34:35 +0900 Subject: [PATCH] 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 --- 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 5508ec68e..506b58232 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -3454,7 +3454,7 @@ do_change_pin (app_t app, ctrl_t ctrl, const char *chvnostr, rc = pin2hash_if_kdf (app, 0, resetcode, &result1, &resultlen1); if (!rc) - rc = pin2hash_if_kdf (app, 0, pinvalue, &result2, &resultlen2); + rc = pin2hash_if_kdf (app, 1, pinvalue, &result2, &resultlen2); if (!rc) { bufferlen = resultlen1 + resultlen2;