summaryrefslogtreecommitdiffstats
path: root/sm/certdump.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2006-06-27 16:32:34 +0200
committerWerner Koch <wk@gnupg.org>2006-06-27 16:32:34 +0200
commit98c6970ad1c55d38d7e3d1ba4c97d01dacec281f (patch)
treeaa65e4fe1d1e53aeba2b159b10d5212f0af52a68 /sm/certdump.c
parentPorted patches from 1.4.x (diff)
downloadgnupg2-98c6970ad1c55d38d7e3d1ba4c97d01dacec281f.tar.xz
gnupg2-98c6970ad1c55d38d7e3d1ba4c97d01dacec281f.zip
Various smaller changes
Diffstat (limited to 'sm/certdump.c')
-rw-r--r--sm/certdump.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sm/certdump.c b/sm/certdump.c
index 0d5146abc..2f7c1fd54 100644
--- a/sm/certdump.c
+++ b/sm/certdump.c
@@ -238,6 +238,36 @@ gpgsm_dump_cert (const char *text, ksba_cert_t cert)
}
+/* Log the certificate's name in "#SN/ISSUERDN" format along with
+ TEXT. */
+void
+gpgsm_cert_log_name (const char *text, ksba_cert_t cert)
+{
+ log_info ("%s", text? text:"certificate" );
+ if (cert)
+ {
+ ksba_sexp_t sn;
+ char *p;
+
+ p = ksba_cert_get_issuer (cert, 0);
+ sn = ksba_cert_get_serial (cert);
+ if (p && sn)
+ {
+ log_printf (" #");
+ gpgsm_dump_serial (sn);
+ log_printf ("/");
+ gpgsm_dump_string (p);
+ }
+ else
+ log_printf (" [invalid]");
+ ksba_free (sn);
+ xfree (p);
+ }
+ log_printf ("\n");
+}
+
+
+
/* helper for the rfc2253 string parser */
static const unsigned char *