mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
agent: Ask specific SERIALNO for pksign/pkdecrypt.
* agent/call-scd.c (agent_card_serialno): Add DEMAND argument. * agent/command-ssh.c (card_key_available): Follow the change. * agent/learncard.c (agent_handle_learn): Likewise. * agent/divert-scd.c (ask_for_card): Use DEMAND argument. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
2e6f1c99d4
commit
0801f49b0d
5 changed files with 19 additions and 7 deletions
|
@ -679,16 +679,22 @@ get_serialno_cb (void *opaque, const char *line)
|
|||
/* Return the serial number of the card or an appropriate error. The
|
||||
serial number is returned as a hexstring. */
|
||||
int
|
||||
agent_card_serialno (ctrl_t ctrl, char **r_serialno)
|
||||
agent_card_serialno (ctrl_t ctrl, char **r_serialno, const char *demand)
|
||||
{
|
||||
int rc;
|
||||
char *serialno = NULL;
|
||||
char line[ASSUAN_LINELENGTH];
|
||||
|
||||
rc = start_scd (ctrl);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = assuan_transact (ctrl->scd_local->ctx, "SERIALNO",
|
||||
if (!demand)
|
||||
strcpy (line, "SERIALNO");
|
||||
else
|
||||
snprintf (line, DIM(line), "SERIALNO --demand=%s", demand);
|
||||
|
||||
rc = assuan_transact (ctrl->scd_local->ctx, line,
|
||||
NULL, NULL, NULL, NULL,
|
||||
get_serialno_cb, &serialno);
|
||||
if (rc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue