summaryrefslogtreecommitdiffstats
path: root/ssl_verify_openssl.c
diff options
context:
space:
mode:
authorAdriaan de Jong <dejong@fox-it.com>2011-07-01 14:40:30 +0200
committerDavid Sommerseth <davids@redhat.com>2011-10-22 11:44:36 +0200
commit725336282db0c9f160d6ef577288e5a628959776 (patch)
tree9c18a3d6aad53f65371452a56566206275fe4fb3 /ssl_verify_openssl.c
parentfceecbab9ddd58ccec28aeafa7be39c65f313458 (diff)
downloadopenvpn-725336282db0c9f160d6ef577288e5a628959776.tar.gz
openvpn-725336282db0c9f160d6ef577288e5a628959776.tar.xz
openvpn-725336282db0c9f160d6ef577288e5a628959776.zip
Refactored X509 track feature to be contained within the openssl backend
Signed-off-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: James Yonan <james@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'ssl_verify_openssl.c')
-rw-r--r--ssl_verify_openssl.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/ssl_verify_openssl.c b/ssl_verify_openssl.c
index 1d32255..e49363e 100644
--- a/ssl_verify_openssl.c
+++ b/ssl_verify_openssl.c
@@ -254,22 +254,27 @@ x509_free_subject (char *subject)
#ifdef ENABLE_X509_TRACK
-/*
- * setenv_x509_track function -- save X509 fields to environment,
- * using the naming convention:
- *
- * X509_{cert_depth}_{name}={value}
- *
- * This function differs from setenv_x509 below in the following ways:
- *
- * (1) Only explicitly named attributes in xt are saved, per usage
- * of --x509-track program options.
- * (2) Only the level 0 cert info is saved unless the XT_FULL_CHAIN
- * flag is set in xt->flags (corresponds with prepending a '+'
- * to the name when specified by --x509-track program option).
- * (3) This function supports both X509 subject name fields as
- * well as X509 V3 extensions.
- */
+
+void
+x509_track_add (const struct x509_track **ll_head, const char *name, int msglevel, struct gc_arena *gc)
+{
+ struct x509_track *xt;
+ ALLOC_OBJ_CLEAR_GC (xt, struct x509_track, gc);
+ if (*name == '+')
+ {
+ xt->flags |= XT_FULL_CHAIN;
+ ++name;
+ }
+ xt->name = name;
+ xt->nid = OBJ_txt2nid(name);
+ if (xt->nid != NID_undef)
+ {
+ xt->next = *ll_head;
+ *ll_head = xt;
+ }
+ else
+ msg(msglevel, "x509_track: no such attribute '%s'", name);
+}
/* worker method for setenv_x509_track */
static void