summaryrefslogtreecommitdiffstats
path: root/opendkim.ticket35+37.patch
blob: 68115a12638d688f6a019a376baf2f9acb24bbff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
diff -Naur -x opendkim-2.11.0.orig/configure opendkim-2.11.0/configure
--- opendkim-2.11.0.orig/configure	2015-10-07 16:17:48.000000000 -0700
+++ opendkim-2.11.0/configure	2016-12-20 18:47:51.662158143 -0800
@@ -14700,13 +14700,13 @@
 
 	for d in $strldirs
 	do
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strl.h in $d/strl" >&5
-$as_echo_n "checking for strl.h in $d/strl... " >&6; }
-		if test -f $d/strl/strl.h
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strl.h in $d" >&5
+$as_echo_n "checking for strl.h in $d... " >&6; }
+		if test -f $d/strl.h
 		then
 			unset ac_cv_header_strl_h
 			saved_CPPFLAGS="$CPPFLAGS"
-			CPPFLAGS="$CPPFLAGS -I$d/strl"
+			CPPFLAGS="$CPPFLAGS -I$d"
 			for ac_header in strl.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "strl.h" "ac_cv_header_strl_h" "$ac_includes_default"
@@ -14724,7 +14724,7 @@
 
 		if test x"$strl_h_found" = x"yes"
 		then
-			CPPFLAGS="$CPPFLAGS -I$d/strl"
+			CPPFLAGS="$CPPFLAGS -I$d"
 			break
 		fi
 	done
@@ -16795,77 +16795,39 @@
 fi
 
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_library_init" >&5
-$as_echo_n "checking for library containing SSL_library_init... " >&6; }
-if ${ac_cv_search_SSL_library_init+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char SSL_library_init ();
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <openssl/ssl.h>
 int
 main ()
 {
-return SSL_library_init ();
+SSL_library_init();
   ;
   return 0;
 }
 _ACEOF
-for ac_lib in '' ssl; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_SSL_library_init=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_SSL_library_init+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_SSL_library_init+:} false; then :
-
+if ac_fn_c_try_link "$LINENO"; then :
+  od_have_ossl="yes";
 else
-  ac_cv_search_SSL_library_init=no
+  od_have_ossl="no";
 fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_library_init" >&5
-$as_echo "$ac_cv_search_SSL_library_init" >&6; }
-ac_res=$ac_cv_search_SSL_library_init
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-else
-
-			if test x"$enable_shared" = x"yes"
-			then
-				as_fn_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." "$LINENO" 5
-			fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	if test x"$od_have_ossl" = x"no"
+	then
+		if test x"$enable_shared" = x"yes"
+		then
+			as_fn_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." "$LINENO" 5
+		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"
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_library_init" >&5
+		LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl"
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_library_init" >&5
 $as_echo_n "checking for library containing SSL_library_init... " >&6; }
 if ${ac_cv_search_SSL_library_init+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -16923,10 +16885,7 @@
   as_fn_error $? "libssl not found" "$LINENO" 5
 fi
 
-
-
-fi
-
+	fi
 
 	ac_fn_c_check_decl "$LINENO" "SHA256_DIGEST_LENGTH" "ac_cv_have_decl_SHA256_DIGEST_LENGTH" "
 #include <sys/types.h>
diff -Naur -x opendkim-2.11.0.orig/opendkim/opendkim-crypto.c opendkim-2.11.0/opendkim/opendkim-crypto.c
--- opendkim-2.11.0.orig/opendkim/opendkim-crypto.c	2013-02-25 13:02:41.000000000 -0800
+++ opendkim-2.11.0/opendkim/opendkim-crypto.c	2016-12-20 18:47:03.477027225 -0800
@@ -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)
 		{