[svn] GnuPG - r4976 - trunk/sm

svn author wk cvs at cvs.gnupg.org
Thu Apr 2 09:20:36 CEST 2009


Author: wk
Date: 2009-04-02 09:20:35 +0200 (Thu, 02 Apr 2009)
New Revision: 4976

Modified:
   trunk/sm/ChangeLog
   trunk/sm/keylist.c
Log:
Print the card's S/N in a secret key listing.


Modified: trunk/sm/ChangeLog
===================================================================
--- trunk/sm/ChangeLog	2009-04-02 03:50:50 UTC (rev 4975)
+++ trunk/sm/ChangeLog	2009-04-02 07:20:35 UTC (rev 4976)
@@ -1,3 +1,7 @@
+2009-04-02  Werner Koch  <wk at g10code.com>
+
+	* keylist.c (list_cert_std): Print card serial number.
+
 2009-04-01  Werner Koch  <wk at g10code.com>
 
 	* export.c (popen_protect_tool): Add command line option

Modified: trunk/sm/keylist.c
===================================================================
--- trunk/sm/keylist.c	2009-04-02 03:50:50 UTC (rev 4975)
+++ trunk/sm/keylist.c	2009-04-02 07:20:35 UTC (rev 4976)
@@ -1039,7 +1039,6 @@
   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 @@
   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)
     {




More information about the Gnupg-commits mailing list