aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpg-card.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-11-27 10:28:16 +0000
committerWerner Koch <[email protected]>2020-11-27 10:28:16 +0000
commitad469609b101fe6c1128135180fef8eae13279ff (patch)
treeb186b061f08e93b8d76f9767f52fdff2c0a409ce /tools/gpg-card.c
parentscd: New getinfo sub-command apdu_strerror. (diff)
downloadgnupg-ad469609b101fe6c1128135180fef8eae13279ff.tar.gz
gnupg-ad469609b101fe6c1128135180fef8eae13279ff.zip
card: Let the APDU command prints a description of the status word.
* tools/card-call-scd.c (scd_apdu_strerror): New. * tools/gpg-card.c (cmd_apdu): Print a description. -- Pretty convenient to explore smartcards.
Diffstat (limited to 'tools/gpg-card.c')
-rw-r--r--tools/gpg-card.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/gpg-card.c b/tools/gpg-card.c
index b4cd80c43..f4e33fa64 100644
--- a/tools/gpg-card.c
+++ b/tools/gpg-card.c
@@ -3501,7 +3501,16 @@ cmd_apdu (card_info_t info, char *argstr)
if (err)
goto leave;
if (!with_atr)
- log_info ("Statusword: 0x%04x\n", sw);
+ {
+ if (opt.interactive || opt.verbose)
+ {
+ char *p = scd_apdu_strerror (sw);
+ log_info ("Statusword: 0x%04x (%s)\n", sw, p? p: "?");
+ xfree (p);
+ }
+ else
+ log_info ("Statusword: 0x%04x\n", sw);
+ }
for (i=0; i < resultlen; )
{
size_t save_i = i;