diff options
author | Werner Koch <[email protected]> | 2019-01-29 08:30:15 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-01-29 08:32:20 +0000 |
commit | 9325c92284bb346d11c3591bb2ea88095989361a (patch) | |
tree | 7f2b164030bc746bebff089e157fee768b926048 /tools/card-call-scd.c | |
parent | card: Make printing of key information more flexible. (diff) | |
download | gnupg-9325c92284bb346d11c3591bb2ea88095989361a.tar.gz gnupg-9325c92284bb346d11c3591bb2ea88095989361a.zip |
card: Print keyinfo for PIV cards.
* scd/app-piv.c (do_learn_status): Print CHV-STATUS.
* tools/card-tool.h (struct card_info_s): Rename chvretry to chvinfo.
* tools/card-call-scd.c (learn_status_cb): Depend CHV-STATUS on app
type.
* tools/gpg-card-tool.c (list_piv): New.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/card-call-scd.c')
-rw-r--r-- | tools/card-call-scd.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tools/card-call-scd.c b/tools/card-call-scd.c index abf35ed17..2551b19f6 100644 --- a/tools/card-call-scd.c +++ b/tools/card-call-scd.c @@ -808,9 +808,13 @@ learn_status_cb (void *opaque, const char *line) buf = p = unescape_status_string (line); if (buf) + while (spacep (p)) + p++; + + if (!buf) + ; + else if (parm->apptype == APP_TYPE_OPENPGP) { - while (spacep (p)) - p++; parm->chv1_cached = atoi (p); while (*p && !spacep (p)) p++; @@ -826,14 +830,26 @@ learn_status_cb (void *opaque, const char *line) } for (i=0; *p && i < 3; i++) { - parm->chvretry[i] = atoi (p); + parm->chvinfo[i] = atoi (p); + while (*p && !spacep (p)) + p++; + while (spacep (p)) + p++; + } + } + else if (parm->apptype == APP_TYPE_PIV) + { + for (i=0; *p && DIM (parm->chvinfo); i++) + { + parm->chvinfo[i] = atoi (p); while (*p && !spacep (p)) p++; while (spacep (p)) p++; } - xfree (buf); } + + xfree (buf); } break; |