Commit 36b6bfd3 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Patched opendkim 2.10.3 to work with openssl 1.1.0

parent 1352ba79
all:
tar xf opendkim-2.10.3.tar.gz
cd opendkim-2.10.3 && ./configure --prefix=/usr
patch -Np1 -d opendkim-2.10.3 < opendkim-2.10.3-openssl_1.1.0_compat.patch
cd opendkim-2.10.3 && autoreconf -f -i
cd opendkim-2.10.3 && ./configure --prefix=/usr LDFLAGS=-lldap
$(MAKE) -C opendkim-2.10.3
$(MAKE) -C opendkim-2.10.3 install
rm -rf opendkim-2.10.3
diff -uNr opendkim-2.10.3/configure.ac opendkim-2.10.3-openssl_1.1.0_compat/configure.ac
--- opendkim-2.10.3/configure.ac 2015-05-13 04:13:09.000000000 +0930
+++ opendkim-2.10.3-openssl_1.1.0_compat/configure.ac 2023-07-23 22:53:00.715036483 +0930
@@ -860,26 +860,28 @@
AC_SEARCH_LIBS([ERR_peek_error], [crypto], ,
AC_MSG_ERROR([libcrypto not found]))
- AC_SEARCH_LIBS([SSL_library_init], [ssl], ,
- [
- if test x"$enable_shared" = x"yes"
- then
- AC_MSG_ERROR([Cannot build shared opendkim
- against static openssl libraries.
- Configure with --disable-shared
- to get this working or obtain a
- shared libssl library for
- opendkim to use.])
- fi
- # avoid caching issue - last result of SSL_library_init
- # shouldn't be cached for this next check
- unset ac_cv_search_SSL_library_init
- LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl"
- AC_SEARCH_LIBS([SSL_library_init], [ssl], ,
- AC_MSG_ERROR([libssl not found]), [-ldl])
- ]
- )
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[#include <openssl/ssl.h>]],
+ [[SSL_library_init();]])],
+ [od_have_ossl="yes";],
+ [od_have_ossl="no";])
+ if test x"$od_have_ossl" = x"no"
+ then
+ if test x"$enable_shared" = x"yes"
+ then
+ AC_MSG_ERROR([Cannot build shared opendkim
+ against static openssl libraries.
+ Configure with --disable-shared
+ to get this working or obtain a
+ shared libssl library for
+ opendkim to use.])
+ fi
+
+ LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl"
+ AC_SEARCH_LIBS([SSL_library_init], [ssl], ,
+ AC_MSG_ERROR([libssl not found]), [-ldl])
+ fi
AC_CHECK_DECL([SHA256_DIGEST_LENGTH],
AC_DEFINE([HAVE_SHA256], 1,
diff -uNr opendkim-2.10.3/opendkim/opendkim-crypto.c opendkim-2.10.3-openssl_1.1.0_compat/opendkim/opendkim-crypto.c
--- opendkim-2.10.3/opendkim/opendkim-crypto.c 2013-02-26 07:32:41.000000000 +1030
+++ opendkim-2.10.3-openssl_1.1.0_compat/opendkim/opendkim-crypto.c 2023-07-23 22:53:00.715036483 +0930
@@ -222,7 +222,11 @@
{
assert(pthread_setspecific(id_key, ptr) == 0);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000
+ OPENSSL_thread_stop();
+#else
ERR_remove_state(0);
+#endif
free(ptr);
@@ -392,11 +396,15 @@
{
if (crypto_init_done)
{
+#if OPENSSL_VERSION_NUMBER >= 0x10100000
+ OPENSSL_thread_stop();
+#else
CRYPTO_cleanup_all_ex_data();
CONF_modules_free();
EVP_cleanup();
ERR_free_strings();
ERR_remove_state(0);
+#endif
if (nmutexes > 0)
{
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment