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
|
@ -3472,14 +3472,17 @@ cmd_apdu (card_info_t info, char *argstr)
|
|||
|
||||
if (with_atr || handle_more || exlenstr)
|
||||
options = xasprintf ("%s%s%s%.*s",
|
||||
with_atr == 2? " --dump-atr": with_atr? " --atr":"",
|
||||
with_atr == 2? " --dump-atr":
|
||||
with_atr? " --data-atr":"",
|
||||
handle_more?" --more":"",
|
||||
exlenstr?" ":"", exlenstrlen, exlenstr?exlenstr:"");
|
||||
exlenstr?" --exlen=":"",
|
||||
exlenstrlen, exlenstr?exlenstr:"");
|
||||
|
||||
err = scd_apdu (argstr, options, &sw, &result, &resultlen);
|
||||
if (err)
|
||||
goto leave;
|
||||
log_info ("Statusword: 0x%04x\n", sw);
|
||||
if (!with_atr)
|
||||
log_info ("Statusword: 0x%04x\n", sw);
|
||||
for (i=0; i < resultlen; )
|
||||
{
|
||||
size_t save_i = i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue