summaryrefslogtreecommitdiffstats
path: root/kbx/keybox-blob.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-09-10 12:50:45 +0200
committerWerner Koch <wk@gnupg.org>2020-09-10 12:50:45 +0200
commitc9677d416e6ff190c589af35b514a01a787085fb (patch)
tree979cca6df7aa51346b0165b4bbfaeecc782377b8 /kbx/keybox-blob.c
parentkeyboxd: Use D-lines instead of a separate thread. (diff)
downloadgnupg2-c9677d416e6ff190c589af35b514a01a787085fb.tar.xz
gnupg2-c9677d416e6ff190c589af35b514a01a787085fb.zip
keyboxd: Add basic support for X.509.
* kbx/keybox-blob.c (x509_email_kludge): Rename to ... (_keybox_x509_email_kludge): this and make global. * kbx/backend.h: Include ksba.h. * kbx/backend-support.c (be_get_x509_serial): New. (be_get_x509_keygrip): New. * kbx/backend-sqlite.c (table_definitions): New table 'issuers'. (run_select_statement): Implements modes ISSUER, ISSUER_SN, SUBJECT. (store_into_userid): Add arg override_mbox. (store_into_issuer): New. (be_sqlite_store): Implement x509 part. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'kbx/keybox-blob.c')
-rw-r--r--kbx/keybox-blob.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kbx/keybox-blob.c b/kbx/keybox-blob.c
index 1210f3773..a0ba40502 100644
--- a/kbx/keybox-blob.c
+++ b/kbx/keybox-blob.c
@@ -841,12 +841,10 @@ _keybox_create_openpgp_blob (KEYBOXBLOB *r_blob,
}
-#ifdef KEYBOX_WITH_X509
-
/* Return an allocated string with the email address extracted from a
DN. Note hat we use this code also in ../sm/keylist.c. */
-static char *
-x509_email_kludge (const char *name)
+char *
+_keybox_x509_email_kludge (const char *name)
{
const char *p, *string;
unsigned char *buf;
@@ -887,6 +885,8 @@ x509_email_kludge (const char *name)
+#ifdef KEYBOX_WITH_X509
+
/* Note: We should move calculation of the digest into libksba and
remove that parameter */
int
@@ -965,7 +965,7 @@ _keybox_create_x509_blob (KEYBOXBLOB *r_blob, ksba_cert_t cert,
names = tmp;
}
names[blob->nuids++] = p;
- if (!i && (p=x509_email_kludge (p)))
+ if (!i && (p=_keybox_x509_email_kludge (p)))
names[blob->nuids++] = p; /* due to !i we don't need to check bounds*/
}