diff options
author | Werner Koch <[email protected]> | 2020-08-27 09:55:37 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-08-27 09:55:37 +0000 |
commit | a0a4744bd0640e587b33ec3dae819ec4054f0472 (patch) | |
tree | ece157a3a81e47c197406159b8e1ce3a146787c8 /tools/gpg-card.c | |
parent | scd: Fix reading of the ATR for card type detection. (diff) | |
download | gnupg-a0a4744bd0640e587b33ec3dae819ec4054f0472.tar.gz gnupg-a0a4744bd0640e587b33ec3dae819ec4054f0472.zip |
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 <[email protected]>
Diffstat (limited to 'tools/gpg-card.c')
-rw-r--r-- | tools/gpg-card.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/gpg-card.c b/tools/gpg-card.c index bf3663924..9238b4759 100644 --- a/tools/gpg-card.c +++ b/tools/gpg-card.c @@ -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; |