Multiple CRLs : a patch for a "crl-verify-path" option
Hi,
As I said on "openvpn-users", OpenVPN can't handle multiple CRL. It's an issue when the PKI have multiple CAs, typically an offline root CA and intermediate CAs.
Attached is a patch for a "--crl-verify-path" option.
The idea is to follow the "openssl way of life" : each CRL is named "0a1b2c3d.r0" where 0a1b2c3d is the hash of the CA DN. Typically, on Unix systems, we builds symlinks to CRLs files with "c_rehash /path/to/crls/".
When OpenVPN must validate a certificate issued by "0a1b2c3d", "--crl-verify-path /etc/openvpn/crls/" will check for any 0a1b2c3d.r{0,1,..,9} CRL file in the /etc/openvpn/crls/ directory.
If the CRL file and the certificate issuers are the same, then OpenVPN normally check the CRL (as with --crl-file ...).
If no CRL file is found or no CRL file match the cert issuer, an error occured.
Thanks,
Signature · 1 line
Thomas
init.c +1 -0
@@ -1307,6 +1307,7 @@ to.verify_command = options->tls_verify; to.verify_x509name = options->tls_remote; to.crl_file = options->crl_file; + to.crl_path = options->crl_path; to.ns_cert_type = options->ns_cert_type; to.es = c->c2.es;
options.c +11 -0
@@ -421,6 +421,9 @@"--askpass [file]: Get PEM password from controlling tty before we daemonize.\n" "--auth-nocache : Don't cache --askpass or --auth-user-pass passwords.\n" "--crl-verify crl: Check peer certificate against a CRL.\n" +"--crl-verify-path path: Check peer certificate against a CRL directory.\n" +" This directory must contain all CRLs with their 'hashed'\n" +" name. path must have a trailing slash (/) on Unix system.\n" "--tls-verify cmd: Execute shell command cmd to verify the X509 name of a\n" " pending TLS connection that has otherwise passed all other\n" " tests of certification. cmd should return 0 to allow\n"
@@ -1107,6 +1110,7 @@SHOW_STR (tls_verify);SHOW_STR (tls_remote);SHOW_STR (crl_file); +SHOW_STR (crl_path);SHOW_INT (ns_cert_type);SHOW_INT (tls_timeout);
@@ -1636,6 +1640,7 @@MUST_BE_UNDEF (single_session);MUST_BE_UNDEF (tls_exit);MUST_BE_UNDEF (crl_file); +MUST_BE_UNDEF (crl_path);MUST_BE_UNDEF (key_method);MUST_BE_UNDEF (ns_cert_type);
@@ -4348,6 +4353,12 @@VERIFY_PERMISSION (OPT_P_GENERAL ); options->crl_file = p[1 ]; } +else if (streq (p[0 ],"crl-verify-path" ) && p[1 ]) + { + ++i; +VERIFY_PERMISSION (OPT_P_GENERAL ); + options->crl_path = p[1 ]; + }else if (streq (p[0 ],"tls-verify" ) && p[1 ]) { ++i;
options.h +1 -0
@@ -364,6 +364,7 @@const char *tls_verify;const char *tls_remote;const char *crl_file; +const char *crl_path;int ns_cert_type;/* set to 0, NS_SSL_SERVER, or NS_SSL_CLIENT */ #ifdef WIN32 const char *cryptoapi_cert;
ssl.c +72 -0
78 lines not on this page · raw message
ssl.h +1 -0
@@ -409,6 +409,7 @@const char *verify_command;const char *verify_x509name;const char *crl_file; +const char *crl_path;int ns_cert_type;/* allow openvpn config info to be