aboutsummaryrefslogtreecommitdiffstats
path: root/sm/certdump.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2007-11-19 16:03:50 +0000
committerWerner Koch <[email protected]>2007-11-19 16:03:50 +0000
commit55ba204bfa848c2e591a29fedc9f103103493a57 (patch)
treee37263e4d3a25e2aa300faf4c5240191b54ea1a7 /sm/certdump.c
parentUpdated (diff)
downloadgnupg-55ba204bfa848c2e591a29fedc9f103103493a57.tar.gz
gnupg-55ba204bfa848c2e591a29fedc9f103103493a57.zip
Started to implement the audit log feature.
Pass PINENTRY_USER_DATA and XAUTHORITY to Pinentry. Improved support for the quality bar. Minor internal restructuring. Translation fixes.
Diffstat (limited to 'sm/certdump.c')
-rw-r--r--sm/certdump.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/sm/certdump.c b/sm/certdump.c
index 9798cce4c..66c395f32 100644
--- a/sm/certdump.c
+++ b/sm/certdump.c
@@ -242,6 +242,37 @@ gpgsm_dump_cert (const char *text, ksba_cert_t cert)
}
+/* Return a new string holding the format serial number and issuer
+ ("#SN/issuer"). No filtering on invalid characters is done.
+ Caller must release the string. On memory failure NULL is
+ returned. */
+char *
+gpgsm_format_sn_issuer (ksba_sexp_t sn, const char *issuer)
+{
+ char *p, *p1;
+
+ if (sn && issuer)
+ {
+ p1 = gpgsm_format_serial (sn);
+ if (!p1)
+ p = xtrystrdup ("[invalid SN]");
+ else
+ {
+ p = xtrymalloc (strlen (p1) + strlen (issuer) + 2 + 1);
+ if (p)
+ {
+ *p = '#';
+ strcpy (stpcpy (stpcpy (p+1, p1),"/"), issuer);
+ }
+ xfree (p1);
+ }
+ }
+ else
+ p = xtrystrdup ("[invalid SN/issuer]");
+ return p;
+}
+
+
/* Log the certificate's name in "#SN/ISSUERDN" format along with
TEXT. */
void
@@ -272,6 +303,8 @@ gpgsm_cert_log_name (const char *text, ksba_cert_t cert)
+
+
/* helper for the rfc2253 string parser */
static const unsigned char *