comparison src/gnutls-1-fixes.patch @ 2768:172cd8ec1feb

update package gnutls
author Mark Brand <mabrand@mabrand.nl>
date Thu, 20 Sep 2012 13:10:23 +0200
parents 185b0c693c77
children 1a91124dd342
comparison
equal deleted inserted replaced
2767:69b720fb1a9f 2768:172cd8ec1feb
1 This file is part of MXE. 1 This file is part of MXE.
2 See index.html for further information. 2 See index.html for further information.
3 3
4 Contains ad hoc patches for cross building. 4 Contains ad hoc patches for cross building.
5 5
6 From 18aa82eb060ca9ded9720091300a6c31af8382a9 Mon Sep 17 00:00:00 2001 6 From 90387fb055e690a0d47c247f2ec8c2478bc7c942 Mon Sep 17 00:00:00 2001
7 From: Mark Brand <mabrand@mabrand.nl> 7 From: Mark Brand <mabrand@mabrand.nl>
8 Date: Fri, 28 Oct 2011 09:23:41 +0200 8 Date: Fri, 28 Oct 2011 09:23:41 +0200
9 Subject: [PATCH 1/5] add missing static library linking 9 Subject: [PATCH 1/7] add missing static library linking
10 10
11 11
12 diff --git a/lib/gnutls.pc.in b/lib/gnutls.pc.in 12 diff --git a/lib/gnutls.pc.in b/lib/gnutls.pc.in
13 index c45f8f3..57d0dbb 100644 13 index c45f8f3..57d0dbb 100644
14 --- a/lib/gnutls.pc.in 14 --- a/lib/gnutls.pc.in
23 Cflags: -I${includedir} 23 Cflags: -I${includedir}
24 -- 24 --
25 1.7.10.4 25 1.7.10.4
26 26
27 27
28 From bd254ee873a2f7d6027661beae5d88372f10aa93 Mon Sep 17 00:00:00 2001 28 From 622969864d2c2ae3e96572bae6e64e3d585d86eb Mon Sep 17 00:00:00 2001
29 From: Mark Brand <mabrand@mabrand.nl> 29 From: Mark Brand <mabrand@mabrand.nl>
30 Date: Thu, 24 Nov 2011 15:06:06 +0100 30 Date: Thu, 24 Nov 2011 15:06:06 +0100
31 Subject: [PATCH 2/5] disable doc and test (mingw-cross-env specific) 31 Subject: [PATCH 2/7] disable doc and test (mingw-cross-env specific)
32 32
33 33
34 diff --git a/Makefile.am b/Makefile.am 34 diff --git a/Makefile.am b/Makefile.am
35 index 0afe4bd..da7436a 100644 35 index 2eebb77..1633fcb 100644
36 --- a/Makefile.am 36 --- a/Makefile.am
37 +++ b/Makefile.am 37 +++ b/Makefile.am
38 @@ -23,7 +23,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-valgrind-tests 38 @@ -23,7 +23,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-valgrind-tests
39 39
40 SUBDIRS = gl lib extra po 40 SUBDIRS = gl lib extra po
46 SUBDIRS += guile 46 SUBDIRS += guile
47 -- 47 --
48 1.7.10.4 48 1.7.10.4
49 49
50 50
51 From dce8795ce40246c87fc83d1879f02c9923dba2ed Mon Sep 17 00:00:00 2001 51 From 922dd8e34aeedfd2130339b037b92b61840d72eb Mon Sep 17 00:00:00 2001
52 From: Mark Brand <mabrand@mabrand.nl> 52 From: Mark Brand <mabrand@mabrand.nl>
53 Date: Tue, 3 Apr 2012 13:58:42 +0200 53 Date: Tue, 3 Apr 2012 13:58:42 +0200
54 Subject: [PATCH 3/5] Revert "make dist will also make lzip compressed 54 Subject: [PATCH 3/7] Revert "make dist will also make lzip compressed
55 tarball" 55 tarball"
56 56
57 This reverts commit 97ac1bc58274f651338444693bd75441ba12f46f. 57 This reverts commit 97ac1bc58274f651338444693bd75441ba12f46f.
58 58
59 diff --git a/configure.ac b/configure.ac 59 diff --git a/configure.ac b/configure.ac
60 index 0ad765c..74b778e 100644 60 index ccd2729..8797ec7 100644
61 --- a/configure.ac 61 --- a/configure.ac
62 +++ b/configure.ac 62 +++ b/configure.ac
63 @@ -25,7 +25,7 @@ AC_INIT([GnuTLS], [3.0.19], [bug-gnutls@gnu.org]) 63 @@ -25,7 +25,7 @@ AC_INIT([GnuTLS], [3.1.1], [bug-gnutls@gnu.org])
64 AC_CONFIG_AUX_DIR([build-aux]) 64 AC_CONFIG_AUX_DIR([build-aux])
65 AC_CONFIG_MACRO_DIR([m4]) 65 AC_CONFIG_MACRO_DIR([m4])
66 66
67 -AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz dist-lzip -Wall -Werror -Wno-override]) 67 -AM_INIT_AUTOMAKE([1.11.3 no-dist-gzip dist-xz dist-lzip -Wall -Werror -Wno-override])
68 +AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz -Wall -Werror -Wno-override]) 68 +AM_INIT_AUTOMAKE([1.11.3 no-dist-gzip dist-xz -Wall -Werror -Wno-override])
69 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 69 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
70 AM_CONFIG_HEADER(config.h) 70 AM_CONFIG_HEADER(config.h)
71 71
72 -- 72 --
73 1.7.10.4 73 1.7.10.4
74 74
75 75
76 From ae55a00b99a60b65e459ebe7ada215ace70b56db Mon Sep 17 00:00:00 2001 76 From fcd06b20700bbf26b740d1c9d22750c829ef6216 Mon Sep 17 00:00:00 2001
77 From: Mark Brand <mabrand@mabrand.nl> 77 From: Mark Brand <mabrand@mabrand.nl>
78 Date: Wed, 6 Jun 2012 09:57:24 +0200 78 Date: Wed, 6 Jun 2012 09:57:24 +0200
79 Subject: [PATCH 4/5] AM_PROG_AR for automake 1.12 compatibility 79 Subject: [PATCH 4/7] AM_PROG_AR for automake 1.12 compatibility
80 80
81 Taken from 81 Taken from
82 http://lists.gnu.org/archive/html/automake/2012-05/msg00014.html 82 http://lists.gnu.org/archive/html/automake/2012-05/msg00014.html
83 83
84 diff --git a/configure.ac b/configure.ac 84 diff --git a/configure.ac b/configure.ac
85 index 74b778e..d045aaf 100644 85 index 8797ec7..fb167f9 100644
86 --- a/configure.ac 86 --- a/configure.ac
87 +++ b/configure.ac 87 +++ b/configure.ac
88 @@ -37,6 +37,7 @@ dnl Checks for programs. 88 @@ -37,6 +37,7 @@ dnl Checks for programs.
89 AC_PROG_CC 89 AC_PROG_CC
90 AM_PROG_AS 90 AM_PROG_AS
95 # For includes/gnutls/gnutls.h.in. 95 # For includes/gnutls/gnutls.h.in.
96 -- 96 --
97 1.7.10.4 97 1.7.10.4
98 98
99 99
100 From dd5b4ce15f94ba9bdbbab9d5036eea0a284e9715 Mon Sep 17 00:00:00 2001 100 From 6b6c5670a25161c61c6bc24a45ede8a4daf6590b Mon Sep 17 00:00:00 2001
101 From: Mark Brand <mabrand@mabrand.nl> 101 From: Mark Brand <mabrand@mabrand.nl>
102 Date: Wed, 18 Jul 2012 00:58:59 +0200 102 Date: Thu, 16 Aug 2012 11:13:47 +0200
103 Subject: [PATCH 5/5] relax automake 103 Subject: [PATCH 5/7] allow automake warnings not to be errors
104 104
105 105
106 diff --git a/configure.ac b/configure.ac 106 diff --git a/configure.ac b/configure.ac
107 index d045aaf..e9afeb4 100644 107 index fb167f9..36b4026 100644
108 --- a/configure.ac 108 --- a/configure.ac
109 +++ b/configure.ac 109 +++ b/configure.ac
110 @@ -25,7 +25,7 @@ AC_INIT([GnuTLS], [3.0.19], [bug-gnutls@gnu.org]) 110 @@ -25,7 +25,7 @@ AC_INIT([GnuTLS], [3.1.1], [bug-gnutls@gnu.org])
111 AC_CONFIG_AUX_DIR([build-aux]) 111 AC_CONFIG_AUX_DIR([build-aux])
112 AC_CONFIG_MACRO_DIR([m4]) 112 AC_CONFIG_MACRO_DIR([m4])
113 113
114 -AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz -Wall -Werror -Wno-override]) 114 -AM_INIT_AUTOMAKE([1.11.3 no-dist-gzip dist-xz -Wall -Werror -Wno-override])
115 +AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz -Wall -Wno-override]) 115 +AM_INIT_AUTOMAKE([1.11.3 no-dist-gzip dist-xz -Wall -Wno-override])
116 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 116 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
117 AM_CONFIG_HEADER(config.h) 117 AM_CONFIG_HEADER(config.h)
118 118
119 -- 119 --
120 1.7.10.4 120 1.7.10.4
121 121
122
123 From 46635a2529108e077ee2585bd3de5532415cf68b Mon Sep 17 00:00:00 2001
124 From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
125 Date: Sat, 15 Sep 2012 13:43:28 +0200
126 Subject: [PATCH 6/7] mingw32 support. Based on patch by LRN. (cherry picked
127 from commit 2cc740eb52abac318176c49f8e8358666c8457cd)
128
129
130 diff --git a/lib/gnutls_global.c b/lib/gnutls_global.c
131 index 8b84f46..4c9eabf 100644
132 --- a/lib/gnutls_global.c
133 +++ b/lib/gnutls_global.c
134 @@ -270,6 +270,13 @@ gnutls_global_init (void)
135 goto out;
136 }
137
138 + result = gnutls_system_global_init ();
139 + if (result < 0)
140 + {
141 + gnutls_assert ();
142 + goto out;
143 + }
144 +
145 #ifdef ENABLE_PKCS11
146 gnutls_pkcs11_init (GNUTLS_PKCS11_FLAG_AUTO, NULL);
147 #endif
148 @@ -302,6 +309,7 @@ gnutls_global_deinit (void)
149 asn1_delete_structure (&_gnutls_pkix1_asn);
150 _gnutls_crypto_deregister ();
151 _gnutls_cryptodev_deinit ();
152 + gnutls_system_global_deinit ();
153 #ifdef ENABLE_PKCS11
154 gnutls_pkcs11_deinit ();
155 #endif
156 diff --git a/lib/system.c b/lib/system.c
157 index 067f189..b22e07d 100644
158 --- a/lib/system.c
159 +++ b/lib/system.c
160 @@ -31,6 +31,11 @@
161 #ifdef _WIN32
162 # include <windows.h>
163 # include <wincrypt.h>
164 +# if defined(__MINGW32__) && !defined(__MINGW64__) && __MINGW32_MAJOR_VERSION <= 3 && __MINGW32_MINOR_VERSION <= 20
165 +typedef PCCRL_CONTEXT WINAPI (*Type_CertEnumCRLsInStore) (HCERTSTORE hCertStore, PCCRL_CONTEXT pPrevCrlContext);
166 +static Type_CertEnumCRLsInStore Loaded_CertEnumCRLsInStore;
167 +static HMODULE Crypt32_dll;
168 +# endif
169
170 #else
171 # ifdef HAVE_PTHREAD_LOCKS
172 @@ -51,10 +56,7 @@
173 /* System specific function wrappers.
174 */
175
176 -/* wrappers for write() and writev()
177 - */
178 #ifdef _WIN32
179 -
180 int
181 system_errno (gnutls_transport_ptr p)
182 {
183 @@ -150,9 +152,6 @@ int fd = GNUTLS_POINTER_TO_INT(ptr);
184 /* Thread stuff */
185
186 #ifdef HAVE_WIN32_LOCKS
187 -
188 -
189 -/* FIXME: win32 locks are untested */
190 static int
191 gnutls_system_mutex_init (void **priv)
192 {
193 @@ -285,6 +284,41 @@ mutex_deinit_func gnutls_mutex_deinit = gnutls_system_mutex_deinit;
194 mutex_lock_func gnutls_mutex_lock = gnutls_system_mutex_lock;
195 mutex_unlock_func gnutls_mutex_unlock = gnutls_system_mutex_unlock;
196
197 +int
198 +gnutls_system_global_init ()
199 +{
200 +#ifdef _WIN32
201 +# if defined(__MINGW32__) && !defined(__MINGW64__) && __MINGW32_MAJOR_VERSION <= 3 && __MINGW32_MINOR_VERSION <= 20
202 + HMODULE crypto;
203 + crypto = LoadLibraryA ("Crypt32.dll");
204 +
205 + if (crypto == NULL)
206 + return GNUTLS_E_CRYPTO_INIT_FAILED;
207 +
208 + Loaded_CertEnumCRLsInStore = (Type_CertEnumCRLsInStore) GetProcAddress (crypto, "CertEnumCRLsInStore");
209 + if (Loaded_CertEnumCRLsInStore == NULL)
210 + {
211 + FreeLibrary (crypto);
212 + return GNUTLS_E_CRYPTO_INIT_FAILED;
213 + }
214 +
215 + Crypt32_dll = crypto;
216 +# endif
217 +#endif
218 + return 0;
219 +}
220 +
221 +void
222 +gnutls_system_global_deinit ()
223 +{
224 +#ifdef _WIN32
225 +# if defined(__MINGW32__) && !defined(__MINGW64__) && __MINGW32_MAJOR_VERSION <= 3 && __MINGW32_MINOR_VERSION <= 20
226 + FreeLibrary (Crypt32_dll);
227 +# endif
228 +#endif
229 +}
230 +
231 +
232 #define CONFIG_PATH ".gnutls"
233
234 /* Returns a path to store user-specific configuration
235 @@ -392,7 +426,7 @@ gnutls_x509_trust_list_add_system_trust(gnutls_x509_trust_list_t list,
236 if (store == NULL) return GNUTLS_E_FILE_ERROR;
237
238 cert = CertEnumCertificatesInStore(store, NULL);
239 - crl = CertEnumCRLsInStore(store, NULL);
240 + crl = Loaded_CertEnumCRLsInStore(store, NULL);
241
242 while(cert != NULL)
243 {
244 @@ -414,7 +448,7 @@ gnutls_x509_trust_list_add_system_trust(gnutls_x509_trust_list_t list,
245 data.size = crl->cbCrlEncoded;
246 gnutls_x509_trust_list_add_trust_mem(list, NULL, &data, GNUTLS_X509_FMT_DER, tl_flags, tl_vflags);
247 }
248 - crl = CertEnumCRLsInStore(store, crl);
249 + crl = Loaded_CertEnumCRLsInStore(store, crl);
250 }
251 CertCloseStore(store, 0);
252 }
253 diff --git a/lib/system.h b/lib/system.h
254 index 0178bd5..0afbdd2 100644
255 --- a/lib/system.h
256 +++ b/lib/system.h
257 @@ -71,4 +71,7 @@ struct timespec ts;
258
259 int _gnutls_find_config_path(char* path, size_t max_size);
260
261 +int gnutls_system_global_init ();
262 +void gnutls_system_global_deinit ();
263 +
264 #endif /* SYSTEM_H */
265 --
266 1.7.10.4
267
268
269 From ee1fab5fb04a698fb50e6ba2b571424ef40ffbbe Mon Sep 17 00:00:00 2001
270 From: Mark Brand <mabrand@mabrand.nl>
271 Date: Thu, 20 Sep 2012 12:59:19 +0200
272 Subject: [PATCH 7/7] add missing libs to Libs.private
273
274
275 diff --git a/lib/gnutls.pc.in b/lib/gnutls.pc.in
276 index 57d0dbb..02a6ef7 100644
277 --- a/lib/gnutls.pc.in
278 +++ b/lib/gnutls.pc.in
279 @@ -19,6 +19,6 @@ Description: Transport Security Layer implementation for the GNU system
280 URL: http://www.gnu.org/software/gnutls/
281 Version: @VERSION@
282 Libs: -L${libdir} -lgnutls
283 -Libs.private: @LTLIBNETTLE@ @LIBS@
284 +Libs.private: @LTLIBNETTLE@ @LIBS@ -lcrypt32 -lws2_32
285 @GNUTLS_REQUIRES_PRIVATE@
286 Cflags: -I${includedir}
287 --
288 1.7.10.4
289