mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
scd: New option to APDU command to return the ATR as data.
* scd/command.c (cmd_apdu): Add new option --data-atr. * tools/gpg-card.c (cmd_apdu): Use that here. Also fix the --exlen option and do not print the statusword in atr mode. * tools/card-call-scd.c (scd_apdu): Detect atr mode anddon't assume a status word. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
95b5a852e2
commit
a0a4744bd0
3 changed files with 29 additions and 8 deletions
|
@ -1933,6 +1933,8 @@ cmd_apdu (assuan_context_t ctx, char *line)
|
|||
size_t exlen;
|
||||
|
||||
if (has_option (line, "--dump-atr"))
|
||||
with_atr = 3;
|
||||
else if (has_option (line, "--data-atr"))
|
||||
with_atr = 2;
|
||||
else
|
||||
with_atr = has_option (line, "--atr");
|
||||
|
@ -1969,7 +1971,7 @@ cmd_apdu (assuan_context_t ctx, char *line)
|
|||
rc = gpg_error (GPG_ERR_INV_CARD);
|
||||
goto leave;
|
||||
}
|
||||
if (with_atr == 2)
|
||||
if (with_atr == 3)
|
||||
{
|
||||
char *string, *p, *pend;
|
||||
|
||||
|
@ -1986,7 +1988,19 @@ cmd_apdu (assuan_context_t ctx, char *line)
|
|||
rc = assuan_send_data (ctx, p, strlen (p));
|
||||
es_free (string);
|
||||
if (rc)
|
||||
goto leave;
|
||||
{
|
||||
xfree (atr);
|
||||
goto leave;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (with_atr == 2)
|
||||
{
|
||||
rc = assuan_send_data (ctx, atr, atrlen);
|
||||
if (rc)
|
||||
{
|
||||
xfree (atr);
|
||||
goto leave;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue