1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2019-01-29 09:30:15 +01:00
parent 237880175f
commit 9325c92284
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
4 changed files with 70 additions and 12 deletions

View file

@ -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++;
}
xfree (buf);
}
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);
}
break;