]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: Detect OPENSSL_cleanup() via configure
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 5 Feb 2017 19:10:04 +0000 (21:10 +0200)
committerGitLab <gitlab@git.dovecot.net>
Mon, 6 Feb 2017 08:16:30 +0000 (10:16 +0200)
It's ugly to have both OpenSSL version number check and a special LibreSSL
check.

m4/ssl.m4
src/lib-ssl-iostream/dovecot-openssl-common.c

index 5f8503f3ac74a993bc974081c4a0d02ecdb8755a..d303b1821c894bc47265ff2f9bccdacad2667d7c 100644 (file)
--- a/m4/ssl.m4
+++ b/m4/ssl.m4
@@ -102,6 +102,9 @@ AC_DEFUN([DOVECOT_SSL], [
         AC_DEFINE(HAVE_SSL_CTX_SET1_CURVES_LIST,, [Define if you have SSL_CTX_set1_curves_list])
       fi
 
+      AC_CHECK_LIB(ssl, OPENSSL_cleanup, [
+        AC_DEFINE(HAVE_OPENSSL_CLEANUP,, [OpenSSL supports OPENSSL_cleanup()])
+      ],, $SSL_LIBS)
       AC_CHECK_LIB(ssl, SSL_get_current_compression, [
         AC_DEFINE(HAVE_SSL_COMPRESSION,, [Build with OpenSSL compression])
       ],, $SSL_LIBS)
index ece359b08fea0a4abac6398b1ccf26003a7dad21..b63690ac9517bcadff7d1d9c64b5532d24f32079 100644 (file)
@@ -101,7 +101,7 @@ bool dovecot_openssl_common_global_unref(void)
        ERR_remove_thread_state(NULL);
 #endif
        ERR_free_strings();
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined (LIBRESSL_VERSION_NUMBER)
+#ifdef HAVE_OPENSSL_CLEANUP
        OPENSSL_cleanup();
 #endif
        return FALSE;