1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpg: Let --card--status create a shadow key (card key stub).

* agent/command.c (cmd_learn): Add option --sendinfo.
* agent/learncard.c (agent_handle_learn): Add arg "send" andsend
certifciate only if that is set.
* g10/call-agent.c (agent_scd_learn): Use --sendinfo.  Make INFO
optional.
(agent_learn): Remove.
* g10/keygen.c (gen_card_key): Replace agent_learn by agent_scd_learn.
--

The requirement of using --card-status on the first use of card on a
new box is a bit annoying but the alternative of always checking
whether a card is available before a decryption starts does not sound
promising either.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2014-12-12 12:35:45 +01:00
parent 193815030d
commit f3f9f9b284
6 changed files with 26 additions and 40 deletions

View file

@ -296,10 +296,10 @@ send_cert_back (ctrl_t ctrl, const char *id, void *assuan_context)
return 0;
}
/* Perform the learn operation. If ASSUAN_CONTEXT is not NULL all new
certificates are send back via Assuan. */
/* Perform the learn operation. If ASSUAN_CONTEXT is not NULL and
SEND is true all new certificates are send back via Assuan. */
int
agent_handle_learn (ctrl_t ctrl, void *assuan_context)
agent_handle_learn (ctrl_t ctrl, int send, void *assuan_context)
{
int rc;
@ -369,7 +369,7 @@ agent_handle_learn (ctrl_t ctrl, void *assuan_context)
log_info (" id: %s (type=%d)\n",
citem->id, citem->type);
if (assuan_context)
if (assuan_context && send)
{
rc = send_cert_back (ctrl, citem->id, assuan_context);
if (rc)
@ -439,9 +439,9 @@ agent_handle_learn (ctrl_t ctrl, void *assuan_context)
}
if (opt.verbose)
log_info ("stored\n");
log_info (" id: %s - shadow key created\n", item->id);
if (assuan_context)
if (assuan_context && send)
{
CERTINFO citem;