diff options
| author | Werner Koch <[email protected]> | 2021-03-12 08:21:57 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2021-03-12 08:31:17 +0000 |
| commit | 5732e7a8e97cebf8e850c472e644e2a9b040836f (patch) | |
| tree | 06987165f537056be9983c912bda613cc7a5f5b5 /scd/app-openpgp.c | |
| parent | scd: Fix computing fingerprint for ECC with SOS. (diff) | |
| download | gnupg-5732e7a8e97cebf8e850c472e644e2a9b040836f.tar.gz gnupg-5732e7a8e97cebf8e850c472e644e2a9b040836f.zip | |
scd: New option --pcsc-shared.
* scd/scdaemon.h (opt): Add field opcsc_shared.
* scd/scdaemon.c (opcscShared): New.
(opts): Add "--pcsc-shared".
(main): Set flag.
* scd/apdu.c (connect_pcsc_card): Use it.
(pcsc_get_status): Take flag in account.
* scd/app-openpgp.c (cache_pin): Bypass in shared mode.
(verify_chv2: Do not auto verify chv1 in shared mode.
* scd/app-piv.c (cache_pin): By pass caceh in shared mode.
--
This option should in general not be used. The patch tries to limit
bad effects but using shared mode is somewhat dangerous depending on
the other PC/SC users.
Diffstat (limited to 'scd/app-openpgp.c')
| -rw-r--r-- | scd/app-openpgp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 987a31be3..fcae4d713 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -2483,10 +2483,15 @@ chvno_to_keyref (int chvno) static void cache_pin (app_t app, ctrl_t ctrl, int chvno, const char *pin) { - const char *keyref = chvno_to_keyref (chvno); + const char *keyref; + if (opt.pcsc_shared) + return; + + keyref = chvno_to_keyref (chvno); if (!keyref) return; + switch (APP_CARD(app)->cardtype) { case CARDTYPE_YUBIKEY: break; @@ -2707,7 +2712,7 @@ verify_chv2 (app_t app, ctrl_t ctrl, return rc; app->did_chv2 = 1; - if (!app->did_chv1 && !app->force_chv1 && pinvalue) + if (!app->did_chv1 && !app->force_chv1 && pinvalue && !opt.pcsc_shared) { /* For convenience we verify CHV1 here too. We do this only if the card is not configured to require a verification before |
