From e607175dfa8e53d35964e5f650babb597c1c72b5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 28 May 2023 11:53:53 +0100 Subject: Fix ssl_openssl on OpenSSL versions older than 1.1.1. Fixes a regression introduced in commit eba5cb9dc9. --- src/modules/extra/m_ssl_openssl.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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"; -- cgit v1.3.1-10-gc9f91