From d60ec76aec688cd0464f774c65303828ee5b6dbf187ff0f454f2b7d7fb33705d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 3 Mar 2018 16:31:38 +0000 Subject: [PATCH] Accepting request 577378 from home:elvigia:branches:server:mail - SSL support was silently lost on openSSL 1.1 update. libesmtp-openssl11.patch makes things work again. OBS-URL: https://build.opensuse.org/request/show/577378 OBS-URL: https://build.opensuse.org/package/show/server:mail/libesmtp?expand=0&rev=4 --- libesmtp-openssl11.patch | 77 ++++++++++++++++++++++++++++++++++++++++ libesmtp.changes | 6 ++++ libesmtp.spec | 7 ++-- 3 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 libesmtp-openssl11.patch diff --git a/libesmtp-openssl11.patch b/libesmtp-openssl11.patch new file mode 100644 index 0000000..f243ba4 --- /dev/null +++ b/libesmtp-openssl11.patch @@ -0,0 +1,77 @@ +Index: libesmtp-1.0.6/ntlm/ntlmdes.c +=================================================================== +--- libesmtp-1.0.6.orig/ntlm/ntlmdes.c ++++ libesmtp-1.0.6/ntlm/ntlmdes.c +@@ -26,9 +26,21 @@ + #include + #include + #include ++#include + + #include "ntlm.h" + ++/* OpenSSL 1.1 compat shim */ ++#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) ++# define des_cblock DES_cblock ++# define const_des_cblock const_DES_cblock ++# define des_key_schedule DES_key_schedule ++# define des_set_odd_parity(k) DES_set_odd_parity((k)) ++# define des_set_key(k,ks) DES_set_key((k),&(ks)) ++# define des_ecb_encrypt(i,o,k,e) DES_ecb_encrypt((i),(o),&(k),(e)) ++ ++#endif ++ + static void + lm_deshash (void *result, const_des_cblock *iv, const void *secret) + { +Index: libesmtp-1.0.6/configure.ac +=================================================================== +--- libesmtp-1.0.6.orig/configure.ac ++++ libesmtp-1.0.6/configure.ac +@@ -303,17 +303,8 @@ if test x$with_openssl != xno ; then + ) + fi + if test x$with_openssl != xno ; then +- AC_CHECK_LIB(ssl, SSL_library_init, [ +- with_openssl=yes +- LIBS="-lssl -lcrypto $LIBS" +- ], [ +- if test x"$with_openssl" = xyes ; then +- AC_MSG_ERROR([cannot find the ssl library]) +- else +- with_openssl=no +- fi], +- -lcrypto +- ) ++PKG_CHECK_MODULES([SSL], [libssl]) ++PKG_CHECK_MODULES([CRYPTO], [libcrypto]) + fi + + dnl ######################################################################### +Index: libesmtp-1.0.6/ntlm/Makefile.am +=================================================================== +--- libesmtp-1.0.6.orig/ntlm/Makefile.am ++++ libesmtp-1.0.6/ntlm/Makefile.am +@@ -8,4 +8,5 @@ AM_CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@ + lib_LTLIBRARIES = sasl-ntlm.la + + sasl_ntlm_la_SOURCES = client-ntlm.c ntlmdes.c ntlmstruct.c ntlm.h +-sasl_ntlm_la_LDFLAGS = -module -avoid-version @NTLM_LIBS@ ++sasl_ntlm_la_LDFLAGS = -no-undefined -module -shared -avoid-version -export-dynamic ++sasl_ntlm_la_LIBADD = $(CRYPTO_LIBS) +Index: libesmtp-1.0.6/Makefile.am +=================================================================== +--- libesmtp-1.0.6.orig/Makefile.am ++++ libesmtp-1.0.6/Makefile.am +@@ -18,9 +18,9 @@ libesmtp_la_SOURCES = auth-client.c base + libesmtp-private.h message-source.h protocol-states.h \ + protocol.h rfc2822date.h siobuf.h tokens.h \ + getaddrinfo.h gethostbyname.h missing.h +-libesmtp_la_LIBADD = @LTLIBOBJS@ ++libesmtp_la_LIBADD = @LTLIBOBJS@ $(CRYPTO_LIBS) $(SSL_LIBS) + +-libesmtp_la_LDFLAGS = -export-dynamic \ ++libesmtp_la_LDFLAGS = -export-dynamic -Wl,--no-undefined \ + -version-info $(LIBESMTP_VERSION) + + include_HEADERS = libesmtp.h auth-client.h auth-plugin.h diff --git a/libesmtp.changes b/libesmtp.changes index 6cd8e1e..3c142ae 100644 --- a/libesmtp.changes +++ b/libesmtp.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Feb 16 20:12:12 UTC 2018 - crrodriguez@opensuse.org + +- SSL support was silently lost on openSSL 1.1 update. + libesmtp-openssl11.patch makes things work again. + ------------------------------------------------------------------- Fri Sep 30 14:58:41 UTC 2016 - crrodriguez@opensuse.org diff --git a/libesmtp.spec b/libesmtp.spec index e288e2d..0bfc85b 100644 --- a/libesmtp.spec +++ b/libesmtp.spec @@ -30,7 +30,9 @@ Patch0: libesmtp-removedecls.diff Patch1: libesmtp-1.0.4-bloat.patch # PATCH-FIX-UPSTREAM libesmtp-tlsv12.patch crrodriguez@opensuse.org -- All TLS clients must support and use the highest TLS version available Patch2: libesmtp-tlsv12.patch +Patch3: libesmtp-openssl11.patch BuildRequires: openssl-devel +BuildRequires: libtool BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -57,9 +59,10 @@ functionality is not that program's primary purpose. %patch0 %patch1 %patch2 -p1 - +%patch3 -p1 %build -%configure --disable-static --with-pic \ +autoreconf -fiv +%configure --with-openssl=yes --disable-static --with-pic \ --enable-ntlm \ --enable-etrn \ --disable-isoc