Fix broken SSL module (#1555081)

This commit is contained in:
Miro Hrončok 2018-03-14 11:33:05 +01:00 committed by Charalampos Stratakis
parent b3ef145e9d
commit 30f9dc6ace
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,24 @@
From 439956a149f8a3eb44646498c63b2ef3337d5f3d Mon Sep 17 00:00:00 2001
From: Christian Heimes <christian@python.org>
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 <christian@python.org>
---
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 */

View File

@ -104,7 +104,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: 6%{?dist}
Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@ -751,6 +751,12 @@ Patch287: 00287-fix-thread-hanging-on-inaccessible-nfs-server.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.,
@ -1069,6 +1075,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch285 -p1
%patch287 -p1
%patch298 -p1
%patch299 -p1
%if 0%{?_module_build}
@ -1955,6 +1962,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
* Wed Mar 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.14-7
- Fix broken SSL module
Resolves: rhbz#1555081
* Tue Mar 13 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.7.14-6
- Do not send IP addresses in SNI TLS extension