1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00
* gpgsm.c: New command --learn-card
* call-agent.c (learn_cb,gpgsm_agent_learn): New.
* gpgsm.c (main): Print error messages for non-implemented commands.
agent/
* learncard.c: New.
* divert-scd.c (ask_for_card): The serial number is binary so
convert it to hex here.
* findkey.c (agent_write_private_key): New.
* genkey.c (store_key): And use it here.
scd/
* pkdecrypt.c (agent_pkdecrypt): Changed the way the diversion is done.
* divert-scd.c (divert_pkdecrypt): Changed interface and
implemented it.
This commit is contained in:
Werner Koch 2002-03-06 14:16:37 +00:00
parent 7a5d7787a0
commit 4e637f2285
16 changed files with 649 additions and 85 deletions

View file

@ -64,6 +64,21 @@ reset_notify (ASSUAN_CONTEXT ctx)
ctrl->digest.valuelen = 0;
}
/* Check whether the option NAME appears in LINE */
static int
has_option (const char *line, const char *name)
{
const char *s;
int n = strlen (name);
s = strstr (line, name);
return (s && (s == line || spacep (s-1)) && (!s[n] || spacep (s+n)));
}
/* ISTRUSTED <hexstring_with_fingerprint>
Return OK when we have an entry with this fingerprint in our
@ -463,18 +478,18 @@ cmd_clear_passphrase (ASSUAN_CONTEXT ctx, char *line)
}
/* LEARN
/* LEARN [--send]
Learn something about the currently inserted smartcard
*/
Learn something about the currently inserted smartcard. With
--send the new certificates are send back. */
static int
cmd_learn (ASSUAN_CONTEXT ctx, char *line)
{
int rc;
rc = agent_card_learn ();
rc = agent_handle_learn (has_option (line, "--send")? ctx : NULL);
if (rc)
log_error ("agent_learn_card failed: %s\n", gnupg_strerror (rc));
log_error ("agent_handle_learn failed: %s\n", gnupg_strerror (rc));
return map_to_assuan_status (rc);
}