From cc58e7d338d6c1f51924f08f16997f0cfb0f66bc Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Mar 14 2018 10:33:05 +0000 Subject: Fix broken SSL module (#1555081) --- diff --git a/00299-fix-ssl-module-pymax.patch b/00299-fix-ssl-module-pymax.patch new file mode 100644 index 0000000..4f8c8da --- /dev/null +++ b/00299-fix-ssl-module-pymax.patch @@ -0,0 +1,24 @@ +From 439956a149f8a3eb44646498c63b2ef3337d5f3d Mon Sep 17 00:00:00 2001 +From: Christian Heimes +Date: Sun, 25 Feb 2018 13:08:05 +0100 +Subject: [PATCH] Fix ssl module, Python 2.7 doesn't have Py_MAX (#5878) + +Signed-off-by: Christian Heimes +--- + Modules/_ssl.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Modules/_ssl.c b/Modules/_ssl.c +index af66a581e15a..f9ed94dee1e1 100644 +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -610,7 +610,8 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock, + } + #elif defined(HAVE_INET_PTON) + #ifdef ENABLE_IPV6 +- char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))]; ++ #define PySSL_MAX(x, y) (((x) > (y)) ? (x) : (y)) ++ char packed[PySSL_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))]; + #else + char packed[sizeof(struct in_addr)]; + #endif /* ENABLE_IPV6 */ diff --git a/python2.spec b/python2.spec index 8cdbea3..f239aab 100644 --- a/python2.spec +++ b/python2.spec @@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming language Name: %{python} # Remember to also rebase python-docs when changing this: Version: 2.7.14 -Release: 14%{?dist} +Release: 15%{?dist} License: Python Group: Development/Languages Requires: %{python}-libs%{?_isa} = %{version}-%{release} @@ -786,6 +786,12 @@ Patch297: 00297-fix-int-in-bool-context-warnings.patch # Fixed upstream: https://bugs.python.org/issue32185 Patch298: 00298-do-not-send-IP-in-SNI-TLS-extension.patch +# 00299 # +# Fix ssl module, Python 2.7 doesn't have Py_MAX +# The previous patch 298 broke python2. This is a fixup. +# Fixed upstream: https://github.com/python/cpython/pull/5878 +Patch299: 00299-fix-ssl-module-pymax.patch + # (New patches go here ^^^) # # When adding new patches to "python2" and "python3" in Fedora, EL, etc., @@ -1113,6 +1119,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c %patch293 -p1 %patch297 -p1 %patch298 -p1 +%patch299 -p1 %if 0%{?_module_build} @@ -1991,6 +1998,10 @@ CheckPython \ # ====================================================== %changelog +* Wed Mar 14 2018 Miro Hrončok - 2.7.14-15 +- Fix broken SSL module +Resolves: rhbz#1555081 + * Tue Mar 13 2018 Charalampos Stratakis - 2.7.14-14 - Do not send IP addresses in SNI TLS extension