python: update to 2.7.14 & add libressl patch
[unleashed-userland.git] / components / python / python27 / patches / patch-Modules__ssl_c.patch
blob3914ad0bbb0bc11aec05ecb2dbec4bc6b6dcf405
1 $OpenBSD: patch-Modules__ssl_c,v 1.6 2018/03/17 22:30:04 sthen Exp $
3 XXX maybe the second hunk can go away now we have auto-init, I'm not sure
4 exactly what python's lock protects
6 Index: Modules/_ssl.c
7 --- a/Modules/_ssl.c.orig
8 +++ b/Modules/_ssl.c
9 @@ -95,7 +95,8 @@ struct py_ssl_library_code {
10 /* Include generated data (error codes) */
11 #include "_ssl_data.h"
13 -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
14 +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && \
15 + (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL)
16 # define OPENSSL_VERSION_1_1 1
17 #endif
19 @@ -130,6 +131,9 @@ struct py_ssl_library_code {
20 /* OpenSSL 1.1.0+ */
21 #ifndef OPENSSL_NO_SSL2
22 #define OPENSSL_NO_SSL2
23 +#endif
24 +#if defined(LIBRESSL_VERSION_NUMBER) && defined(WITH_THREAD)
25 +#define HAVE_OPENSSL_CRYPTO_LOCK
26 #endif
27 #else /* OpenSSL < 1.1.0 */
28 #if defined(WITH_THREAD)