scd: Fix a regression for OpenPGP card.

* scd/app-openpgp.c (verify_chv2): Make sure loading keys.

--

Fixes-commit: d2f1a0a791
Reported-by: Michał Górny
GnuPG-bug-id: 5039
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-09-01 15:23:59 +09:00
parent bcae9cd4e3
commit 0a9665187a
1 changed files with 5 additions and 0 deletions

View File

@ -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);