]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Disable certificate notBefore/notAfter sanity check on OpenSSL < 1.0.2
authorSteffan Karger <steffan@karger.me>
Mon, 14 Dec 2015 22:14:45 +0000 (23:14 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 15 Dec 2015 07:48:21 +0000 (08:48 +0100)
The SSL_CTX_get0_certificate() function I used in 091edd8e is available in
OpenSSL 1.0.2+ only.  Older versions seem to not have a useful alternative.
The remaining option would then be to create a cache for our parsed
certificate, but that would mean adding more struct members and code for
the select group of people that do use an up-to-date openvpn, but do not
update their openssl.  I don't think that's worth it.  So just disable the
code for older openssl versions.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1450131285-30182-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/10802
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/ssl_openssl.c

index 2b74818baeaad5074905cb0e258ae9942802bb3b..4792b088c96907e7d5926b5788029c81f5d5d38a 100644 (file)
@@ -353,6 +353,7 @@ tls_ctx_restrict_ciphers(struct tls_root_ctx *ctx, const char *ciphers)
 void
 tls_ctx_check_cert_time (const struct tls_root_ctx *ctx)
 {
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
   int ret;
   const X509 *cert = SSL_CTX_get0_certificate(ctx->ctx);
 
@@ -375,6 +376,7 @@ tls_ctx_check_cert_time (const struct tls_root_ctx *ctx)
     {
       msg (M_WARN, "WARNING: Your certificate has expired!");
     }
+#endif
 }
 
 void