mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
scd: Support automatic card selection for READCERT with keygrip.
* scd/command.c (cmd_readcert): Select by KEYGRIP. -- GnuPG-bug-id: 6003 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
1b0c4c2778
commit
ea97683d58
@ -639,6 +639,7 @@ cmd_readcert (assuan_context_t ctx, char *line)
|
||||
unsigned char *cert;
|
||||
size_t ncert;
|
||||
card_t card;
|
||||
const char *keygrip = NULL;
|
||||
|
||||
if ((rc = open_card (ctrl)))
|
||||
return rc;
|
||||
@ -647,7 +648,10 @@ cmd_readcert (assuan_context_t ctx, char *line)
|
||||
if (!line)
|
||||
return gpg_error_from_syserror ();
|
||||
|
||||
card = card_get (ctrl, NULL);
|
||||
if (strlen (line) == 40)
|
||||
keygrip = line;
|
||||
|
||||
card = card_get (ctrl, keygrip);
|
||||
if (!card)
|
||||
{
|
||||
xfree (line);
|
||||
|
Loading…
x
Reference in New Issue
Block a user