summaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2019-09-05 13:53:58 +0200
committerWerner Koch <wk@gnupg.org>2019-09-05 13:53:58 +0200
commit5d9eb060b764d45152edb266cd8a08f5724ad709 (patch)
treef301b40bc6f25e5c16fef1684be5b58aee6e83d2 /scd
parentdoc: Update description of --debug (diff)
downloadgnupg2-5d9eb060b764d45152edb266cd8a08f5724ad709.tar.xz
gnupg2-5d9eb060b764d45152edb266cd8a08f5724ad709.zip
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 <wk@gnupg.org>
Diffstat (limited to 'scd')
-rw-r--r--scd/app-openpgp.c6
1 files changed, 6 insertions, 0 deletions
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;
}