From 5d9eb060b764d45152edb266cd8a08f5724ad709 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 5 Sep 2019 13:53:58 +0200 Subject: [PATCH] scd:openpgp: Avoid PIN caching issues after re-select. * scd/app-openpgp.c (do_reselect): Clear PIN cache flags. -- It seems that the verification status of the OpenPGP app on a Yubikey is reset on a select. We need to reflect this in our cache to avoid a "Bad PIN" error on computing a signature. Signed-off-by: Werner Koch --- scd/app-openpgp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index f72070448..4f76caac3 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -5228,6 +5228,12 @@ do_reselect (app_t app, ctrl_t ctrl) * a special flag value. */ err = iso7816_select_application (app_get_slot (app), openpgp_aid, sizeof openpgp_aid, 0x0001); + if (!err) + { + app->did_chv1 = 0; + app->did_chv2 = 0; + app->did_chv3 = 0; + } return err; }