aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-05-28 11:53:53 +0100
committerGravatar Sadie Powell2023-05-28 11:53:53 +0100
commite607175dfa8e53d35964e5f650babb597c1c72b5 (patch)
treeca134b5cde222e1675cffba3268dc8c81c915de0
parentMake it clear that <link:port> is only required for IP listeners. (diff)
Fix ssl_openssl on OpenSSL versions older than 1.1.1.
Fixes a regression introduced in commit eba5cb9dc9.
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 0e26bf1b4..b5fabdb3a 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -704,6 +704,10 @@ class OpenSSLIOHook : public SSLIOHook
certinfo->activation = GetTime(X509_getm_notBefore(cert));
certinfo->expiration = GetTime(X509_getm_notAfter(cert));
+#if OPENSSL_VERSION_NUMBER < 0x10101000L
+# define ASN1_TIME_cmp_time_t ASN1_UTCTIME_cmp_time_t
+#endif
+
int activated = ASN1_TIME_cmp_time_t(X509_getm_notBefore(cert), ServerInstance->Time());
if (activated != -1 && activated != 0)
certinfo->error = "Certificate not activated";