Print the card's S/N in a secret key listing.

This commit is contained in:
Werner Koch 2009-04-02 07:20:35 +00:00
parent 9d6a2a60c2
commit 7d92a25561
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2009-04-02 Werner Koch <wk@g10code.com>
* keylist.c (list_cert_std): Print card serial number.
2009-04-01 Werner Koch <wk@g10code.com>
* export.c (popen_protect_tool): Add command line option

View File

@ -1039,7 +1039,6 @@ list_cert_std (ctrl_t ctrl, ksba_cert_t cert, estream_t fp, int have_secret,
const char *oid;
const unsigned char *cert_der = NULL;
(void)have_secret;
es_fprintf (fp, " ID: 0x%08lX\n",
gpgsm_get_short_fingerprint (cert, NULL));
@ -1215,7 +1214,16 @@ list_cert_std (ctrl_t ctrl, ksba_cert_t cert, estream_t fp, int have_secret,
es_fprintf (fp, " fingerprint: %s\n", dn?dn:"error");
xfree (dn);
if (have_secret)
{
char *cardsn;
p = gpgsm_get_keygrip_hexstring (cert);
if (!gpgsm_agent_keyinfo (ctrl, p, &cardsn) && cardsn)
es_fprintf (fp, " card s/n: %s\n", cardsn);
xfree (cardsn);
xfree (p);
}
if (with_validation)
{