From a0a4744bd0640e587b33ec3dae819ec4054f0472 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 27 Aug 2020 11:55:37 +0200 Subject: 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 --- tools/gpg-card.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tools/gpg-card.c') 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; -- cgit v1.2.3