aboutsummaryrefslogtreecommitdiffstats
path: root/sm/keylist.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2009-04-02 07:20:35 +0000
committerWerner Koch <[email protected]>2009-04-02 07:20:35 +0000
commit7d92a2556121314579d4ff23d0fde767735ffb3a (patch)
treea76478481209d8c6562bf2d2c81bcc6818090d40 /sm/keylist.c
parentPrepare for OpenPGP cards with extended length support. (diff)
downloadgnupg-7d92a2556121314579d4ff23d0fde767735ffb3a.tar.gz
gnupg-7d92a2556121314579d4ff23d0fde767735ffb3a.zip
Print the card's S/N in a secret key listing.
Diffstat (limited to 'sm/keylist.c')
-rw-r--r--sm/keylist.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sm/keylist.c b/sm/keylist.c
index 2de1708a8..2ea722370 100644
--- a/sm/keylist.c
+++ b/sm/keylist.c
@@ -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)
{