diff --git a/g10/call-agent.c b/g10/call-agent.c index 9c2a3f315..a7991baf8 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -336,7 +336,9 @@ start_agent (ctrl_t ctrl, int flag_for_card) if (!(flag_for_card & FLAG_FOR_CARD_SUPPRESS_ERRORS)) rc = warn_version_mismatch (agent_ctx, SCDAEMON_NAME, 2); if (!rc) - rc = assuan_transact (agent_ctx, "SCD SERIALNO", + rc = assuan_transact (agent_ctx, + opt.flags.use_only_openpgp_card? + "SCD SERIALNO openpgp" : "SCD SERIALNO", NULL, NULL, NULL, NULL, learn_status_cb, &info); if (rc && !(flag_for_card & FLAG_FOR_CARD_SUPPRESS_ERRORS)) diff --git a/g10/gpg.c b/g10/gpg.c index 10f6567cd..dc70a130b 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -422,6 +422,7 @@ enum cmd_and_opt_values oKeyOrigin, oRequestOrigin, oNoSymkeyCache, + oUseOnlyOpenPGPCard, oNoop }; @@ -887,6 +888,10 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_n (oNoAutostart, "no-autostart", "@"), ARGPARSE_s_n (oNoSymkeyCache, "no-symkey-cache", "@"), + /* Options which can be used in special circumstances. They are not + * published and we hope they are never required. */ + ARGPARSE_s_n (oUseOnlyOpenPGPCard, "use-only-openpgp-card", "@"), + /* Dummy options with warnings. */ ARGPARSE_s_n (oUseAgent, "use-agent", "@"), ARGPARSE_s_n (oNoUseAgent, "no-use-agent", "@"), @@ -3576,6 +3581,10 @@ main (int argc, char **argv) opt.def_new_key_algo = pargs.r.ret_str; break; + case oUseOnlyOpenPGPCard: + opt.flags.use_only_openpgp_card = 1; + break; + case oNoop: break; default: diff --git a/g10/options.h b/g10/options.h index 0f007c16c..994c1b241 100644 --- a/g10/options.h +++ b/g10/options.h @@ -243,6 +243,9 @@ struct unsigned int rfc4880bis:1; /* Hack: --output is not given but OUTFILE was temporary set to "-". */ unsigned int dummy_outfile:1; + /* Force the use of the OpenPGP card and do not allow the use of + * another card. */ + unsigned int use_only_openpgp_card:1; } flags; /* Linked list of ways to find a key if the key isn't on the local