]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 6 Feb 2017 14:35:57 +0000 (16:35 +0200)
It's ugly to have both OpenSSL version number check and a special LibreSSL
check.

configure.ac
src/lib-ssl-iostream/dovecot-openssl-common.c

index 44cb25078a8fd6a3d923ed82d5a12ace9b28857f..956e25977d018dfa22ce41728b6cef8f7533d8dc 100644 (file)
@@ -1769,6 +1769,9 @@ if test $want_openssl != no && test $have_ssl = no; then
       AC_DEFINE(HAVE_SSL_NEW_MEM_FUNCS,, [Define if CRYPTO_set_mem_functions has new style parameters])
     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;