summaryrefslogtreecommitdiffstats
path: root/kbx
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2001-12-14 14:43:42 +0100
committerWerner Koch <wk@gnupg.org>2001-12-14 14:43:42 +0100
commit7606e3b33a57016b39b02857a7094e378a245ec3 (patch)
treeefbf689db541926ab5a8683e2c39a4e4793e93d4 /kbx
parent* util.h (digitp, hexdigitp): New ctype like macros. (diff)
downloadgnupg2-7606e3b33a57016b39b02857a7094e378a245ec3.tar.xz
gnupg2-7606e3b33a57016b39b02857a7094e378a245ec3.zip
* util.h (digitp, hexdigitp): New ctype like macros.
(atoi_1,atoi_2,atoi_4,xtoi_1,xtoi_2): New. * command.c: Removed the conversion macros as they are now in ../common/util.h.
Diffstat (limited to 'kbx')
-rw-r--r--kbx/keybox-blob.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/kbx/keybox-blob.c b/kbx/keybox-blob.c
index 18503a576..1f5fe2bbd 100644
--- a/kbx/keybox-blob.c
+++ b/kbx/keybox-blob.c
@@ -121,7 +121,6 @@ X.509 specific are noted like [X.509: xxx]
#include "keybox-defs.h"
-
/* special values of the signature status */
#define SF_NONE(a) ( !(a) )
#define SF_NOKEY(a) ((a) & (1<<0))
@@ -768,6 +767,31 @@ _keybox_create_pgp_blob (KEYBOXBLOB *r_blob, KBNODE keyblock)
#endif /*KEYBOX_WITH_OPENPGP*/
#ifdef KEYBOX_WITH_X509
+
+/* return an allocated string with the email address extracted from a
+ DN */
+static char *
+x509_email_kludge (const char *name)
+{
+#if 0
+ if (!strncmp (name, "1.2.840.113549.1.9.1=#", 22)
+ && hexdigitp (name+22) && hexdigitp (name+23))
+ { /* this looks pretty much like an email address in the
+ subjects DN we use this to add an additional user ID
+ entry. This way, openSSL generated keys get a nicer and
+ usable listing */
+ char *buf = NULL;
+
+ /* FIXME */
+
+ return buf;
+ }
+#endif
+ return NULL;
+}
+
+
+
/* Note: We should move calculation of the digest into libksba and
remove that parameter */
int
@@ -813,6 +837,7 @@ _keybox_create_x509_blob (KEYBOXBLOB *r_blob, KsbaCert cert,
names[blob->nuids++] = p;
for (i=0; (p = ksba_cert_get_subject (cert, i)); i++)
{
+
if (blob->nuids >= max_names)
{
unsigned char **tmp;
@@ -826,6 +851,8 @@ _keybox_create_x509_blob (KEYBOXBLOB *r_blob, KsbaCert cert,
}
}
names[blob->nuids++] = p;
+ if (!i && (p=x509_email_kludge (p)))
+ names[blob->nuids++] = p; /* due to !i we don't need to check bounds*/
}
/* space for signature information */