From 0a9665187a7cbf68933b7162fb5f974177684a50 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 1 Sep 2020 15:23:59 +0900 Subject: [PATCH] scd: Fix a regression for OpenPGP card. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * scd/app-openpgp.c (verify_chv2): Make sure loading keys. -- Fixes-commit: d2f1a0a791db3eb03c003365cbcd010bd8066edb Reported-by: Michał Górny GnuPG-bug-id: 5039 Signed-off-by: NIIBE Yutaka --- scd/app-openpgp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 8a1d30d5b..ccc360fc8 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -2357,10 +2357,15 @@ verify_chv2 (app_t app, int rc; char *pinvalue; int pinlen; + int i; if (app->did_chv2) return 0; /* We already verified CHV2. */ + /* Make sure we have load the public keys. */ + for (i = 0; i < 3; i++) + get_public_key (app, i); + if (app->app_local->pk[1].key || app->app_local->pk[2].key) { rc = verify_a_chv (app, pincb, pincb_arg, 2, 0, &pinvalue, &pinlen);