From 1a5cfa538c7c4f1224c1c76c22fcf08380e6731b Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 10 2020 01:37:56 +0000 Subject: import python38-3.8.3-1.module+el8.3.0+7187+a27ec44b --- diff --git a/.gitignore b/.gitignore index 0a63432..b50fd1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/Python-3.8.0.tar.xz +SOURCES/Python-3.8.3.tar.xz diff --git a/.python38.metadata b/.python38.metadata index f6fe148..6c2bce0 100644 --- a/.python38.metadata +++ b/.python38.metadata @@ -1 +1 @@ -7720e0384558c598107cf046c48165fd7e1f5b2c SOURCES/Python-3.8.0.tar.xz +3bafa40df1cd069c112761c388a9f2e94b5d33dd SOURCES/Python-3.8.3.tar.xz diff --git a/SOURCES/00001-rpath.patch b/SOURCES/00001-rpath.patch index d9dd3ce..15f95a9 100644 --- a/SOURCES/00001-rpath.patch +++ b/SOURCES/00001-rpath.patch @@ -1,4 +1,4 @@ -From 8ecb6d320c03242ca94bf2e99d9d80510d5011e1 Mon Sep 17 00:00:00 2001 +From 08c67bfedd07ebec54f5087b59045b8c78fa2a6d Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 13 Jan 2010 21:25:18 +0000 Subject: [PATCH] 00001: Fixup distutils/unixccompiler.py to remove standard @@ -9,7 +9,7 @@ Subject: [PATCH] 00001: Fixup distutils/unixccompiler.py to remove standard 1 file changed, 9 insertions(+) diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py -index d10a78da31..4df4b67810 100644 +index 4d7a6de740..353086a648 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -82,6 +82,15 @@ class UnixCCompiler(CCompiler): @@ -29,5 +29,5 @@ index d10a78da31..4df4b67810 100644 include_dirs=None, extra_preargs=None, extra_postargs=None): fixed_args = self._fix_compile_args(None, macros, include_dirs) -- -2.21.0 +2.26.2 diff --git a/SOURCES/00102-lib64.patch b/SOURCES/00102-lib64.patch index f1f0c8d..5acaf5c 100644 --- a/SOURCES/00102-lib64.patch +++ b/SOURCES/00102-lib64.patch @@ -1,4 +1,4 @@ -From b9f1dd6be195cc3b11a80e6f0dde2096dd8b9855 Mon Sep 17 00:00:00 2001 +From be6b9803109c3702dbff0ed8b0953913206008ca Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 13 Jan 2010 21:25:18 +0000 Subject: [PATCH] 00102: Change the various install paths to use /usr/lib64/ @@ -139,10 +139,10 @@ index b9e2fafbc0..0ae6d35b69 100644 'scripts': '{userbase}/bin', 'data': '{userbase}', diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py -index 41c4229919..543c88432a 100644 +index 1bbc697936..9a7e80dfa0 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py -@@ -266,8 +266,8 @@ class HelperFunctionsTests(unittest.TestCase): +@@ -267,8 +267,8 @@ class HelperFunctionsTests(unittest.TestCase): dirs = site.getsitepackages() if os.sep == '/': # OS X, Linux, FreeBSD, etc @@ -154,7 +154,7 @@ index 41c4229919..543c88432a 100644 'site-packages') self.assertEqual(dirs[0], wanted) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 502317aa0c..4ad3df1122 100644 +index a914a9c70f..406a441082 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -143,7 +143,7 @@ LIBDIR= @libdir@ @@ -198,10 +198,10 @@ index b727f66953..a0c5fb6139 100644 return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); } diff --git a/configure b/configure -index 2a933cdbeb..bec365124e 100755 +index 8886561645..78867c6ffc 100755 --- a/configure +++ b/configure -@@ -15182,9 +15182,9 @@ fi +@@ -15214,9 +15214,9 @@ fi if test x$PLATFORM_TRIPLET = x; then @@ -214,10 +214,10 @@ index 2a933cdbeb..bec365124e 100755 diff --git a/configure.ac b/configure.ac -index a189d42c2c..154a0aa5cc 100644 +index d8de9d4943..477a5ff1cb 100644 --- a/configure.ac +++ b/configure.ac -@@ -4668,9 +4668,9 @@ fi +@@ -4689,9 +4689,9 @@ fi dnl define LIBPL after ABIFLAGS and LDVERSION is defined. AC_SUBST(PY_ENABLE_SHARED) if test x$PLATFORM_TRIPLET = x; then @@ -230,7 +230,7 @@ index a189d42c2c..154a0aa5cc 100644 AC_SUBST(LIBPL) diff --git a/setup.py b/setup.py -index 20d7f35652..024a1035c0 100644 +index b168ed4082..8628b9d1cd 100644 --- a/setup.py +++ b/setup.py @@ -649,7 +649,7 @@ class PyBuildExt(build_ext): @@ -257,5 +257,5 @@ index 20d7f35652..024a1035c0 100644 libraries=readline_libs)) else: -- -2.21.0 +2.26.2 diff --git a/SOURCES/00111-no-static-lib.patch b/SOURCES/00111-no-static-lib.patch index 361af70..ed8ca3e 100644 --- a/SOURCES/00111-no-static-lib.patch +++ b/SOURCES/00111-no-static-lib.patch @@ -1,4 +1,4 @@ -From f6df02cde47874f10e183ead483c90941bb8076f Mon Sep 17 00:00:00 2001 +From 50236468e82a7a19ed3dd7e13cb922e7d3e0ff7f Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 18 Jan 2010 17:59:07 +0000 Subject: [PATCH] 00111: Don't try to build a libpythonMAJOR.MINOR.a @@ -21,7 +21,7 @@ Co-authored-by: Miro Hrončok 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 4ad3df1122..72d202d71b 100644 +index 406a441082..917303dd92 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -562,7 +562,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c @@ -74,5 +74,5 @@ index 4ad3df1122..72d202d71b 100644 $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in -- -2.21.0 +2.26.2 diff --git a/SOURCES/00189-use-rpm-wheels.patch b/SOURCES/00189-use-rpm-wheels.patch index 83487e3..8d44707 100644 --- a/SOURCES/00189-use-rpm-wheels.patch +++ b/SOURCES/00189-use-rpm-wheels.patch @@ -1,40 +1,45 @@ -From e5c11f104e1d2543ac3ba4b3f0a7989821e57947 Mon Sep 17 00:00:00 2001 +From 36f1f2b4620b13bdc7ac1c349253ac07960c33b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 15 Aug 2018 15:36:29 +0200 Subject: [PATCH] 00189: Instead of bundled wheels, use our RPM packaged wheels We keep them in /usr/share/python-wheels --- - Lib/ensurepip/__init__.py | 26 +++++++++++++++++--------- - 1 file changed, 17 insertions(+), 9 deletions(-) + Lib/ensurepip/__init__.py | 32 ++++++++++++++++++++++---------- + 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py -index fc0edec6e3..4d17e413db 100644 +index 566fb2a096..47da08d3d5 100644 --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py -@@ -1,16 +1,27 @@ +@@ -1,6 +1,7 @@ +import distutils.version +import glob import os import os.path -import pkgutil import sys + import runpy import tempfile - +@@ -8,10 +9,24 @@ import tempfile __all__ = ["version", "bootstrap"] +_WHEEL_DIR = "/usr/share/python38-wheels/" -_SETUPTOOLS_VERSION = "41.2.0" ++_wheels = {} -_PIP_VERSION = "19.2.3" +def _get_most_recent_wheel_version(pkg): + prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg)) -+ suffix = "-py2.py3-none-any.whl" -+ pattern = "{}*{}".format(prefix, suffix) -+ versions = (p[len(prefix):-len(suffix)] for p in glob.glob(pattern)) -+ return str(max(versions, key=distutils.version.LooseVersion)) ++ _wheels[pkg] = {} ++ for suffix in "-py2.py3-none-any.whl", "-py3-none-any.whl": ++ pattern = "{}*{}".format(prefix, suffix) ++ for path in glob.glob(pattern): ++ version_str = path[len(prefix):-len(suffix)] ++ _wheels[pkg][version_str] = os.path.basename(path) ++ return str(max(_wheels[pkg], key=distutils.version.LooseVersion)) + + +_SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools") @@ -43,16 +48,18 @@ index fc0edec6e3..4d17e413db 100644 _PROJECTS = [ ("setuptools", _SETUPTOOLS_VERSION), -@@ -96,12 +107,9 @@ def _bootstrap(*, root=None, upgrade=False, user=False, +@@ -105,13 +120,10 @@ def _bootstrap(*, root=None, upgrade=False, user=False, + # additional paths that need added to sys.path additional_paths = [] for project, version in _PROJECTS: - wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version) +- wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version) - whl = pkgutil.get_data( - "ensurepip", - "_bundled/{}".format(wheel_name), - ) - with open(os.path.join(tmpdir, wheel_name), "wb") as fp: - fp.write(whl) ++ wheel_name = _wheels[project][version] + with open(os.path.join(_WHEEL_DIR, wheel_name), "rb") as sfp: + with open(os.path.join(tmpdir, wheel_name), "wb") as fp: + fp.write(sfp.read()) @@ -60,5 +67,5 @@ index fc0edec6e3..4d17e413db 100644 additional_paths.append(os.path.join(tmpdir, wheel_name)) -- -2.21.0 +2.26.2 diff --git a/SOURCES/00251-change-user-install-location.patch b/SOURCES/00251-change-user-install-location.patch index 1e0ddbb..e993c42 100644 --- a/SOURCES/00251-change-user-install-location.patch +++ b/SOURCES/00251-change-user-install-location.patch @@ -1,4 +1,4 @@ -From 76330e0a8798b3b03160edc7e8d42d3dbee756fd Mon Sep 17 00:00:00 2001 +From 197b8de27ebcd17fc5dd51426a639950c6f6c284 Mon Sep 17 00:00:00 2001 From: Michal Cyprian Date: Mon, 26 Jun 2017 16:32:56 +0200 Subject: [PATCH] 00251: Change user install location @@ -60,5 +60,5 @@ index 22d53fa562..9513526109 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) -- -2.21.0 +2.26.2 diff --git a/SOURCES/00274-fix-arch-names.patch b/SOURCES/00274-fix-arch-names.patch index f383a58..26654f2 100644 --- a/SOURCES/00274-fix-arch-names.patch +++ b/SOURCES/00274-fix-arch-names.patch @@ -1,4 +1,4 @@ -From 64c67dbfa789f242e8ffd1ac88bafb4df2842401 Mon Sep 17 00:00:00 2001 +From 3172104314227af128f3ce68e9650663a7c1268c Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 17:16:46 +0200 Subject: [PATCH] 00274: Upstream uses Debian-style architecture naming, change @@ -29,10 +29,10 @@ index ba37cf99e2..52a9ec6662 100755 ppc64le | powerpc64little) basic_machine=powerpc64le-unknown diff --git a/configure.ac b/configure.ac -index 154a0aa5cc..273954f461 100644 +index 477a5ff1cb..aea27ef86a 100644 --- a/configure.ac +++ b/configure.ac -@@ -741,9 +741,9 @@ cat >> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c < Date: Thu, 11 Jul 2019 13:44:13 +0200 Subject: [PATCH] 00328: Restore pyc to TIMESTAMP invalidation mode as default @@ -31,7 +31,7 @@ index 21736896af..310bed5620 100644 else: return PycInvalidationMode.TIMESTAMP diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py -index d6677ab45f..88059b127e 100644 +index d4a68c9320..ed09874023 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -17,6 +17,7 @@ def without_source_date_epoch(fxn): @@ -51,5 +51,5 @@ index d6677ab45f..88059b127e 100644 return wrapper -- -2.21.0 +2.26.2 diff --git a/SOURCES/00329-fips.patch b/SOURCES/00329-fips.patch index f3e383a..4c96d02 100644 --- a/SOURCES/00329-fips.patch +++ b/SOURCES/00329-fips.patch @@ -1,268 +1,7 @@ -From 85855cf6fdc076dee6cd884c8b46d491458c431e Mon Sep 17 00:00:00 2001 -From: "Miss Islington (bot)" - <31488909+miss-islington@users.noreply.github.com> -Date: Thu, 17 Oct 2019 20:48:42 -0700 -Subject: [PATCH 01/38] bpo-33604: Raise TypeError on missing hmac arg. - (GH-16805) - -Also updates the documentation to clarify the situation surrounding -the digestmod parameter that is required despite its position in the -argument list as of 3.8.0 as well as removing old python2 era -references to "binary strings". - -We indavertently had this raise ValueError in 3.8.0 for the missing -arg. This is not considered an API change as no reasonable code would -be catching this missing argument error in order to handle it. -(cherry picked from commit f33c57d5c780da1500619f548585792bb5b750ee) - -Co-authored-by: Gregory P. Smith ---- - Doc/library/hmac.rst | 8 +-- - Lib/hmac.py | 53 ++++++++++--------- - Lib/test/test_hmac.py | 7 ++- - .../2019-10-15-09-47-40.bpo-33604.J12cWT.rst | 3 ++ - 4 files changed, 43 insertions(+), 28 deletions(-) - create mode 100644 Misc/NEWS.d/next/Library/2019-10-15-09-47-40.bpo-33604.J12cWT.rst - -diff --git a/Doc/library/hmac.rst b/Doc/library/hmac.rst -index dc994b07c3..57ac8bb161 100644 ---- a/Doc/library/hmac.rst -+++ b/Doc/library/hmac.rst -@@ -14,12 +14,13 @@ - This module implements the HMAC algorithm as described by :rfc:`2104`. - - --.. function:: new(key, msg=None, digestmod=None) -+.. function:: new(key, msg=None, digestmod='') - - Return a new hmac object. *key* is a bytes or bytearray object giving the - secret key. If *msg* is present, the method call ``update(msg)`` is made. - *digestmod* is the digest name, digest constructor or module for the HMAC -- object to use. It supports any name suitable to :func:`hashlib.new`. -+ object to use. It may be any name suitable to :func:`hashlib.new`. -+ Despite its argument position, it is required. - - .. versionchanged:: 3.4 - Parameter *key* can be a bytes or bytearray object. -@@ -28,6 +29,8 @@ This module implements the HMAC algorithm as described by :rfc:`2104`. - - .. deprecated-removed:: 3.4 3.8 - MD5 as implicit default digest for *digestmod* is deprecated. -+ The digestmod parameter is now required. Pass it as a keyword -+ argument to avoid awkwardness when you do not have an initial msg. - - - .. function:: digest(key, msg, digest) -@@ -127,7 +130,6 @@ This module also provides the following helper function: - a timing attack could theoretically reveal information about the - types and lengths of *a* and *b*—but not their values. - -- - .. versionadded:: 3.3 - - -diff --git a/Lib/hmac.py b/Lib/hmac.py -index 890eaba08e..b769876e6f 100644 ---- a/Lib/hmac.py -+++ b/Lib/hmac.py -@@ -1,4 +1,4 @@ --"""HMAC (Keyed-Hashing for Message Authentication) Python module. -+"""HMAC (Keyed-Hashing for Message Authentication) module. - - Implements the HMAC algorithm as described by RFC 2104. - """ -@@ -30,23 +30,25 @@ class HMAC: - """ - blocksize = 64 # 512-bit HMAC; can be changed in subclasses. - -- def __init__(self, key, msg = None, digestmod = None): -+ def __init__(self, key, msg=None, digestmod=''): - """Create a new HMAC object. - -- key: key for the keyed hash object. -- msg: Initial input for the hash, if provided. -- digestmod: Required. A module supporting PEP 247. *OR* -- A hashlib constructor returning a new hash object. *OR* -- A hash name suitable for hashlib.new(). -+ key: bytes or buffer, key for the keyed hash object. -+ msg: bytes or buffer, Initial input for the hash or None. -+ digestmod: A hash name suitable for hashlib.new(). *OR* -+ A hashlib constructor returning a new hash object. *OR* -+ A module supporting PEP 247. - -- Note: key and msg must be a bytes or bytearray objects. -+ Required as of 3.8, despite its position after the optional -+ msg argument. Passing it as a keyword argument is -+ recommended, though not required for legacy API reasons. - """ - - if not isinstance(key, (bytes, bytearray)): - raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__) - -- if digestmod is None: -- raise ValueError('`digestmod` is required.') -+ if not digestmod: -+ raise TypeError("Missing required parameter 'digestmod'.") - - if callable(digestmod): - self.digest_cons = digestmod -@@ -90,8 +92,7 @@ class HMAC: - return "hmac-" + self.inner.name - - def update(self, msg): -- """Update this hashing object with the string msg. -- """ -+ """Feed data from msg into this hashing object.""" - self.inner.update(msg) - - def copy(self): -@@ -119,7 +120,7 @@ class HMAC: - def digest(self): - """Return the hash value of this hashing object. - -- This returns a string containing 8-bit data. The object is -+ This returns the hmac value as bytes. The object is - not altered in any way by this function; you can continue - updating the object after calling this function. - """ -@@ -132,30 +133,34 @@ class HMAC: - h = self._current() - return h.hexdigest() - --def new(key, msg = None, digestmod = None): -+def new(key, msg=None, digestmod=''): - """Create a new hashing object and return it. - -- key: The starting key for the hash. -- msg: if available, will immediately be hashed into the object's starting -- state. -+ key: bytes or buffer, The starting key for the hash. -+ msg: bytes or buffer, Initial input for the hash, or None. -+ digestmod: A hash name suitable for hashlib.new(). *OR* -+ A hashlib constructor returning a new hash object. *OR* -+ A module supporting PEP 247. -+ -+ Required as of 3.8, despite its position after the optional -+ msg argument. Passing it as a keyword argument is -+ recommended, though not required for legacy API reasons. - -- You can now feed arbitrary strings into the object using its update() -+ You can now feed arbitrary bytes into the object using its update() - method, and can ask for the hash value at any time by calling its digest() -- method. -+ or hexdigest() methods. - """ - return HMAC(key, msg, digestmod) - - - def digest(key, msg, digest): -- """Fast inline implementation of HMAC -+ """Fast inline implementation of HMAC. - -- key: key for the keyed hash object. -- msg: input message -+ key: bytes or buffer, The key for the keyed hash object. -+ msg: bytes or buffer, Input message. - digest: A hash name suitable for hashlib.new() for best performance. *OR* - A hashlib constructor returning a new hash object. *OR* - A module supporting PEP 247. -- -- Note: key and msg must be a bytes or bytearray objects. - """ - if (_hashopenssl is not None and - isinstance(digest, str) and digest in _openssl_md_meths): -diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py -index 1bbf201727..ea00367c80 100644 ---- a/Lib/test/test_hmac.py -+++ b/Lib/test/test_hmac.py -@@ -312,10 +312,15 @@ class TestVectorsTestCase(unittest.TestCase): - self.fail('Expected warning about small block_size') - - def test_with_digestmod_no_default(self): -- with self.assertRaises(ValueError): -+ """The digestmod parameter is required as of Python 3.8.""" -+ with self.assertRaisesRegex(TypeError, r'required.*digestmod'): - key = b"\x0b" * 16 - data = b"Hi There" - hmac.HMAC(key, data, digestmod=None) -+ with self.assertRaisesRegex(TypeError, r'required.*digestmod'): -+ hmac.new(key, data) -+ with self.assertRaisesRegex(TypeError, r'required.*digestmod'): -+ hmac.HMAC(key, msg=data, digestmod='') - - - class ConstructorTestCase(unittest.TestCase): -diff --git a/Misc/NEWS.d/next/Library/2019-10-15-09-47-40.bpo-33604.J12cWT.rst b/Misc/NEWS.d/next/Library/2019-10-15-09-47-40.bpo-33604.J12cWT.rst -new file mode 100644 -index 0000000000..fbd73003cf ---- /dev/null -+++ b/Misc/NEWS.d/next/Library/2019-10-15-09-47-40.bpo-33604.J12cWT.rst -@@ -0,0 +1,3 @@ -+Fixed `hmac.new` and `hmac.HMAC` to raise TypeError instead of ValueError -+when the digestmod parameter, now required in 3.8, is omitted. Also -+clarified the hmac module documentation and docstrings. --- -2.25.4 - - -From f01bee1d24524c80d446f702e8b8ff054a583064 Mon Sep 17 00:00:00 2001 -From: "Miss Islington (bot)" - <31488909+miss-islington@users.noreply.github.com> -Date: Thu, 5 Dec 2019 08:51:30 -0800 -Subject: [PATCH 02/38] [3.8] bpo-38270: Fix indentation of test_hmac - assertions (GH-17446) (GH-17450) - -Since https://github.com/python/cpython/commit/c64a1a61e6fc542cada40eb069a239317e1af36e two assertions were indented and thus ignored when running test_hmac. - -This PR fixes it. As the change is quite trivial I didn't add a NEWS entry. - - -https://bugs.python.org/issue38270 -(cherry picked from commit 894331838b256412c95d54051ec46a1cb96f52e7) - - -Co-authored-by: stratakis - - -https://bugs.python.org/issue38270 - - - -Automerge-Triggered-By: @tiran ---- - Lib/test/test_hmac.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py -index ea00367c80..23c108f6e3 100644 ---- a/Lib/test/test_hmac.py -+++ b/Lib/test/test_hmac.py -@@ -367,7 +367,7 @@ class ConstructorTestCase(unittest.TestCase): - digestmod="sha256") - except Exception: - self.fail("Constructor call with bytearray arguments raised exception.") -- self.assertEqual(h.hexdigest(), self.expected) -+ self.assertEqual(h.hexdigest(), self.expected) - - @requires_hashdigest('sha256') - def test_with_memoryview_msg(self): -@@ -375,7 +375,7 @@ class ConstructorTestCase(unittest.TestCase): - h = hmac.HMAC(b"key", memoryview(b"hash this!"), digestmod="sha256") - except Exception: - self.fail("Constructor call with memoryview msg raised exception.") -- self.assertEqual(h.hexdigest(), self.expected) -+ self.assertEqual(h.hexdigest(), self.expected) - - @requires_hashdigest('sha256') - def test_withmodule(self): --- -2.25.4 - - -From 480c5e0c1fd8ed871f54b124528b35e570839a09 Mon Sep 17 00:00:00 2001 +From eba7874ad8a269c1e6e7f56a3f1d759448a0ea83 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 25 Jul 2019 16:19:52 +0200 -Subject: [PATCH 03/38] Expose OpenSSL FIPS_mode() as hashlib.get_fips_mode() +Subject: [PATCH 01/36] Expose OpenSSL FIPS_mode() as hashlib.get_fips_mode() --- Lib/hashlib.py | 5 +++++ @@ -271,7 +10,7 @@ Subject: [PATCH 03/38] Expose OpenSSL FIPS_mode() as hashlib.get_fips_mode() 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/Lib/hashlib.py b/Lib/hashlib.py -index 56873b7278..63ae8368ab 100644 +index 56873b7..63ae836 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -243,6 +243,11 @@ try: @@ -287,7 +26,7 @@ index 56873b7278..63ae8368ab 100644 for __func_name in __always_supported: # try them all, some may not work due to the OpenSSL diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c -index 1513e4e35e..43a69c73d1 100644 +index 3e5f9c3..d38aae9 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -26,6 +26,9 @@ @@ -348,7 +87,7 @@ index 1513e4e35e..43a69c73d1 100644 _HASHLIB_OPENSSL_MD5_METHODDEF _HASHLIB_OPENSSL_SHA1_METHODDEF diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h -index 9aaea47e83..30fd8a9796 100644 +index 9aaea47..30fd8a9 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -620,7 +620,30 @@ exit: @@ -387,10 +126,10 @@ index 9aaea47e83..30fd8a9796 100644 2.25.4 -From ad854d7f0fb26aea7dff9b1da50de9e81fb3ba5c Mon Sep 17 00:00:00 2001 +From 692168044948a41211bb0efabacf0cbfade8db14 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 25 Jul 2019 17:04:06 +0200 -Subject: [PATCH 04/38] Use python's fall backs for the crypto it implements +Subject: [PATCH 02/36] Use python's fall backs for the crypto it implements only if we are not in FIPS mode --- @@ -399,7 +138,7 @@ Subject: [PATCH 04/38] Use python's fall backs for the crypto it implements 2 files changed, 81 insertions(+), 127 deletions(-) diff --git a/Lib/hashlib.py b/Lib/hashlib.py -index 63ae8368ab..1bcfdf9f7f 100644 +index 63ae836..1bcfdf9 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -68,7 +68,6 @@ __all__ = __always_supported + ('new', 'algorithms_guaranteed', @@ -671,7 +410,7 @@ index 63ae8368ab..1bcfdf9f7f 100644 +if not get_fips_mode(): + del __py_new diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py -index 8b53d23ef5..e9abcbb929 100644 +index 8b53d23..e9abcbb 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -945,6 +945,7 @@ class KDFTests(unittest.TestCase): @@ -686,10 +425,10 @@ index 8b53d23ef5..e9abcbb929 100644 2.25.4 -From 351fa613d2e194a7fe5c1f63bc89cbaa340deca5 Mon Sep 17 00:00:00 2001 +From 25b2075a04c0622cd11b8ea986d7d817a1a5d375 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 25 Jul 2019 17:19:06 +0200 -Subject: [PATCH 05/38] Disable Python's hash implementations in FIPS mode, +Subject: [PATCH 03/36] Disable Python's hash implementations in FIPS mode, forcing OpenSSL --- @@ -705,7 +444,7 @@ Subject: [PATCH 05/38] Disable Python's hash implementations in FIPS mode, diff --git a/Include/_hashopenssl.h b/Include/_hashopenssl.h new file mode 100644 -index 0000000000..a726c0d3fb +index 0000000..a726c0d --- /dev/null +++ b/Include/_hashopenssl.h @@ -0,0 +1,66 @@ @@ -776,7 +515,7 @@ index 0000000000..a726c0d3fb + +#endif // !Py_HASHOPENSSL_H diff --git a/Modules/_blake2/blake2b_impl.c b/Modules/_blake2/blake2b_impl.c -index edab31ea22..1daf5c38e2 100644 +index edab31e..1daf5c3 100644 --- a/Modules/_blake2/blake2b_impl.c +++ b/Modules/_blake2/blake2b_impl.c @@ -14,6 +14,7 @@ @@ -806,7 +545,7 @@ index edab31ea22..1daf5c38e2 100644 if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE) diff --git a/Modules/_blake2/blake2module.c b/Modules/_blake2/blake2module.c -index e2a3d420d4..817b716568 100644 +index e2a3d42..817b716 100644 --- a/Modules/_blake2/blake2module.c +++ b/Modules/_blake2/blake2module.c @@ -9,6 +9,7 @@ @@ -827,7 +566,7 @@ index e2a3d420d4..817b716568 100644 if (m == NULL) return NULL; diff --git a/Modules/_blake2/blake2s_impl.c b/Modules/_blake2/blake2s_impl.c -index ef2f7e1980..389711abf1 100644 +index ef2f7e1..389711a 100644 --- a/Modules/_blake2/blake2s_impl.c +++ b/Modules/_blake2/blake2s_impl.c @@ -14,6 +14,7 @@ @@ -857,7 +596,7 @@ index ef2f7e1980..389711abf1 100644 if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE) diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c -index 43a69c73d1..661ceaa198 100644 +index d38aae9..10a987d 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -17,6 +17,7 @@ @@ -919,7 +658,7 @@ index 43a69c73d1..661ceaa198 100644 py_digest_name(const EVP_MD *md) { diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c -index c1fb6185e2..34d09b45d9 100644 +index c1fb618..34d09b4 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -18,6 +18,7 @@ @@ -956,7 +695,7 @@ index c1fb6185e2..34d09b45d9 100644 return NULL; } diff --git a/setup.py b/setup.py -index 20d7f35652..0066006772 100644 +index 024a103..a16961e 100644 --- a/setup.py +++ b/setup.py @@ -1688,7 +1688,6 @@ class PyBuildExt(build_ext): @@ -1071,10 +810,10 @@ index 20d7f35652..0066006772 100644 2.25.4 -From 502fab3354771128a7b18a4e117cf09327803a6c Mon Sep 17 00:00:00 2001 +From 97d839b2d8c03a7b428907e51a44269fdfe3a48d Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 12 Dec 2019 16:58:31 +0100 -Subject: [PATCH 06/38] Expose all hashes available to OpenSSL +Subject: [PATCH 04/36] Expose all hashes available to OpenSSL --- Modules/_hashopenssl.c | 150 ++++++++++++++++ @@ -1082,7 +821,7 @@ Subject: [PATCH 06/38] Expose all hashes available to OpenSSL 2 files changed, 447 insertions(+), 1 deletion(-) diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c -index 661ceaa198..625e2d2e8f 100644 +index 10a987d..e10dbd7 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -190,6 +190,12 @@ py_digest_by_name(const char *name) @@ -1257,7 +996,7 @@ index 661ceaa198..625e2d2e8f 100644 }; diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h -index 30fd8a9796..e96a752e27 100644 +index 30fd8a9..e96a752 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -331,6 +331,302 @@ exit: @@ -1573,17 +1312,17 @@ index 30fd8a9796..e96a752e27 100644 2.25.4 -From bc9f365705cf600dc26cd16585a25bcde6b43ff1 Mon Sep 17 00:00:00 2001 +From b681f084a48d5f2f3eb5257b33e968268850ea7b Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 25 Jul 2019 18:13:45 +0200 -Subject: [PATCH 07/38] Fix tests +Subject: [PATCH 05/36] Fix tests --- Lib/test/test_hashlib.py | 58 +++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py -index e9abcbb929..2a55fd4309 100644 +index e9abcbb..2a55fd4 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -190,7 +190,9 @@ class HashLibTestCase(unittest.TestCase): @@ -1705,10 +1444,10 @@ index e9abcbb929..2a55fd4309 100644 2.25.4 -From de23605b73ef563766405f678822ec3b6e3645ea Mon Sep 17 00:00:00 2001 +From 78dea79c8a284940a5d5997646745cb29f74d720 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 26 Jul 2019 11:27:57 +0200 -Subject: [PATCH 08/38] Change FIPS exceptions from _blake2, _sha3 module init +Subject: [PATCH 06/36] Change FIPS exceptions from _blake2, _sha3 module init to ImportError --- @@ -1720,7 +1459,7 @@ Subject: [PATCH 08/38] Change FIPS exceptions from _blake2, _sha3 module init 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Include/_hashopenssl.h b/Include/_hashopenssl.h -index a726c0d3fb..47ed003042 100644 +index a726c0d..47ed003 100644 --- a/Include/_hashopenssl.h +++ b/Include/_hashopenssl.h @@ -39,7 +39,7 @@ _setException(PyObject *exc) @@ -1756,7 +1495,7 @@ index a726c0d3fb..47ed003042 100644 #endif // !Py_HASHOPENSSL_H diff --git a/Modules/_blake2/blake2b_impl.c b/Modules/_blake2/blake2b_impl.c -index 1daf5c38e2..97ce89d33c 100644 +index 1daf5c3..97ce89d 100644 --- a/Modules/_blake2/blake2b_impl.c +++ b/Modules/_blake2/blake2b_impl.c @@ -97,7 +97,7 @@ py_blake2b_new_impl(PyTypeObject *type, PyObject *data, int digest_size, @@ -1778,7 +1517,7 @@ index 1daf5c38e2..97ce89d33c 100644 GET_BUFFER_VIEW_OR_ERROUT(data, &buf); diff --git a/Modules/_blake2/blake2module.c b/Modules/_blake2/blake2module.c -index 817b716568..a9c7cbc7eb 100644 +index 817b716..a9c7cbc 100644 --- a/Modules/_blake2/blake2module.c +++ b/Modules/_blake2/blake2module.c @@ -58,7 +58,7 @@ PyInit__blake2(void) @@ -1791,7 +1530,7 @@ index 817b716568..a9c7cbc7eb 100644 m = PyModule_Create(&blake2_module); if (m == NULL) diff --git a/Modules/_blake2/blake2s_impl.c b/Modules/_blake2/blake2s_impl.c -index 389711abf1..c4447b4fe8 100644 +index 389711a..c4447b4 100644 --- a/Modules/_blake2/blake2s_impl.c +++ b/Modules/_blake2/blake2s_impl.c @@ -97,7 +97,7 @@ py_blake2s_new_impl(PyTypeObject *type, PyObject *data, int digest_size, @@ -1813,7 +1552,7 @@ index 389711abf1..c4447b4fe8 100644 GET_BUFFER_VIEW_OR_ERROUT(data, &buf); diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c -index 34d09b45d9..3079e1e3a4 100644 +index 34d09b4..3079e1e 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -161,7 +161,7 @@ static PyTypeObject SHAKE256type; @@ -1847,17 +1586,17 @@ index 34d09b45d9..3079e1e3a4 100644 2.25.4 -From 104d4b32cb6b28f48f6e03a0b9ec51126a833b72 Mon Sep 17 00:00:00 2001 +From be76f342f801a674fdbb622fd6e096bd7a09e1e6 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 26 Jul 2019 11:24:09 +0200 -Subject: [PATCH 09/38] Make hashlib importable under FIPS mode +Subject: [PATCH 07/36] Make hashlib importable under FIPS mode --- Lib/hashlib.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Lib/hashlib.py b/Lib/hashlib.py -index 1bcfdf9f7f..898e6dca56 100644 +index 1bcfdf9..898e6dc 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -137,12 +137,14 @@ def __get_openssl_constructor(name): @@ -1882,10 +1621,10 @@ index 1bcfdf9f7f..898e6dca56 100644 2.25.4 -From 168538a496916c0b92c11c433fd0f9545c33f535 Mon Sep 17 00:00:00 2001 +From 15b34c0943d79ec7d236a5eefab636a288dc0ae1 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 26 Jul 2019 15:41:10 +0200 -Subject: [PATCH 10/38] Implement hmac.new using new built-in module, +Subject: [PATCH 08/36] Implement hmac.new using new built-in module, _hmacopenssl --- @@ -1898,7 +1637,7 @@ Subject: [PATCH 10/38] Implement hmac.new using new built-in module, create mode 100644 Modules/clinic/_hmacopenssl.c.h diff --git a/Lib/hmac.py b/Lib/hmac.py -index b769876e6f..daabc8c142 100644 +index b769876..daabc8c 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -13,6 +13,8 @@ except ImportError: @@ -1970,7 +1709,7 @@ index b769876e6f..daabc8c142 100644 def digest(key, msg, digest): diff --git a/Modules/_hmacopenssl.c b/Modules/_hmacopenssl.c new file mode 100644 -index 0000000000..ca95d725f0 +index 0000000..ca95d72 --- /dev/null +++ b/Modules/_hmacopenssl.c @@ -0,0 +1,396 @@ @@ -2372,7 +2111,7 @@ index 0000000000..ca95d725f0 +} diff --git a/Modules/clinic/_hmacopenssl.c.h b/Modules/clinic/_hmacopenssl.c.h new file mode 100644 -index 0000000000..b472a6eddd +index 0000000..b472a6e --- /dev/null +++ b/Modules/clinic/_hmacopenssl.c.h @@ -0,0 +1,133 @@ @@ -2510,7 +2249,7 @@ index 0000000000..b472a6eddd +} +/*[clinic end generated code: output=10b6e8cac6d7a2c9 input=a9049054013a1b77]*/ diff --git a/setup.py b/setup.py -index 0066006772..6b376040ff 100644 +index a16961e..3d2465d 100644 --- a/setup.py +++ b/setup.py @@ -2251,6 +2251,10 @@ class PyBuildExt(build_ext): @@ -2528,10 +2267,10 @@ index 0066006772..6b376040ff 100644 2.25.4 -From a5091b7016e4d86abaa733cd0dd7c0d066c4c33a Mon Sep 17 00:00:00 2001 +From f72ffcdcee6c59aa61a8df4a3bf6633d200d6417 Mon Sep 17 00:00:00 2001 From: Marcel Plch Date: Mon, 29 Jul 2019 12:45:11 +0200 -Subject: [PATCH 11/38] FIPS review +Subject: [PATCH 09/36] FIPS review * Port _hmacopenssl to multiphase init. * Make _hmacopenssl.HMAC.copy create same type as self. @@ -2542,7 +2281,7 @@ Subject: [PATCH 11/38] FIPS review 2 files changed, 70 insertions(+), 44 deletions(-) diff --git a/Lib/hmac.py b/Lib/hmac.py -index daabc8c142..2ec24da573 100644 +index daabc8c..2ec24da 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -48,7 +48,7 @@ class HMAC: @@ -2555,7 +2294,7 @@ index daabc8c142..2ec24da573 100644 if not isinstance(key, (bytes, bytearray)): diff --git a/Modules/_hmacopenssl.c b/Modules/_hmacopenssl.c -index ca95d725f0..216ed04f23 100644 +index ca95d72..216ed04 100644 --- a/Modules/_hmacopenssl.c +++ b/Modules/_hmacopenssl.c @@ -24,7 +24,10 @@ @@ -2743,10 +2482,10 @@ index ca95d725f0..216ed04f23 100644 2.25.4 -From c482ed4a74e06d17a612d3a286772b62e5a8001a Mon Sep 17 00:00:00 2001 +From 408a7d606654249f4aaa2c26cd960b770429229c Mon Sep 17 00:00:00 2001 From: Marcel Plch Date: Mon, 29 Jul 2019 13:05:04 +0200 -Subject: [PATCH 12/38] revert cosmetic nitpick and remove trailing whitespace +Subject: [PATCH 10/36] revert cosmetic nitpick and remove trailing whitespace --- Lib/hmac.py | 2 +- @@ -2754,7 +2493,7 @@ Subject: [PATCH 12/38] revert cosmetic nitpick and remove trailing whitespace 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/hmac.py b/Lib/hmac.py -index 2ec24da573..daabc8c142 100644 +index 2ec24da..daabc8c 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -48,7 +48,7 @@ class HMAC: @@ -2767,7 +2506,7 @@ index 2ec24da573..daabc8c142 100644 if not isinstance(key, (bytes, bytearray)): diff --git a/Modules/_hmacopenssl.c b/Modules/_hmacopenssl.c -index 216ed04f23..221714ca43 100644 +index 216ed04..221714c 100644 --- a/Modules/_hmacopenssl.c +++ b/Modules/_hmacopenssl.c @@ -363,7 +363,7 @@ static PyType_Slot HmacType_slots[] = { @@ -2792,10 +2531,10 @@ index 216ed04f23..221714ca43 100644 2.25.4 -From fceba59a20d8f22f618777874a63162f520bed69 Mon Sep 17 00:00:00 2001 +From 6ed4037723b1ac437cfd8401355350ef5c47f0e1 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 31 Jul 2019 15:43:43 +0200 -Subject: [PATCH 13/38] Add initial tests for various hashes under FIPS mode +Subject: [PATCH 11/36] Add initial tests for various hashes under FIPS mode --- Lib/test/test_fips.py | 64 +++++++++++++++++++++++++++++++++++++++++++ @@ -2804,7 +2543,7 @@ Subject: [PATCH 13/38] Add initial tests for various hashes under FIPS mode diff --git a/Lib/test/test_fips.py b/Lib/test/test_fips.py new file mode 100644 -index 0000000000..bee911ef40 +index 0000000..bee911e --- /dev/null +++ b/Lib/test/test_fips.py @@ -0,0 +1,64 @@ @@ -2876,17 +2615,17 @@ index 0000000000..bee911ef40 2.25.4 -From 556b34545c0f7d72470faeb186371ffc9c2c997c Mon Sep 17 00:00:00 2001 +From 2548227dff8ae23fb7d3dd45b6e044ff17796547 Mon Sep 17 00:00:00 2001 From: Marcel Plch Date: Thu, 1 Aug 2019 16:39:37 +0200 -Subject: [PATCH 14/38] Initialize HMAC type. +Subject: [PATCH 12/36] Initialize HMAC type. --- Modules/_hmacopenssl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Modules/_hmacopenssl.c b/Modules/_hmacopenssl.c -index 221714ca43..239445a083 100644 +index 221714c..239445a 100644 --- a/Modules/_hmacopenssl.c +++ b/Modules/_hmacopenssl.c @@ -22,12 +22,12 @@ @@ -2945,10 +2684,10 @@ index 221714ca43..239445a083 100644 2.25.4 -From 425d95325f304b0c2a04511a9f8e62208a5bace2 Mon Sep 17 00:00:00 2001 +From 4d40c61ed97eae9169df2e526d935d4997902f97 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 1 Aug 2019 17:57:05 +0200 -Subject: [PATCH 15/38] Use a stronger hash in multiprocessing handshake +Subject: [PATCH 13/36] Use a stronger hash in multiprocessing handshake Adapted from patch by David Malcolm, https://bugs.python.org/issue17258 @@ -2957,7 +2696,7 @@ https://bugs.python.org/issue17258 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py -index c9f995e5fa..64180b245e 100644 +index c9f995e..64180b2 100644 --- a/Lib/multiprocessing/connection.py +++ b/Lib/multiprocessing/connection.py @@ -42,6 +42,10 @@ BUFSIZE = 8192 @@ -2993,17 +2732,17 @@ index c9f995e5fa..64180b245e 100644 2.25.4 -From 5369e3fd06c84a648d056226616c6e796e014b20 Mon Sep 17 00:00:00 2001 +From bc917ee79da1166e9ff94e76bbb2a64044db2fc0 Mon Sep 17 00:00:00 2001 From: Marcel Plch Date: Fri, 2 Aug 2019 17:36:01 +0200 -Subject: [PATCH 16/38] Fix refcounting +Subject: [PATCH 14/36] Fix refcounting --- Modules/_hmacopenssl.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Modules/_hmacopenssl.c b/Modules/_hmacopenssl.c -index 239445a083..9c2882833d 100644 +index 239445a..9c28828 100644 --- a/Modules/_hmacopenssl.c +++ b/Modules/_hmacopenssl.c @@ -373,6 +373,34 @@ static struct PyMethodDef hmacopenssl_functions[] = { @@ -3067,17 +2806,17 @@ index 239445a083..9c2882833d 100644 2.25.4 -From 11bc3a8ba5179defa0c6e86e27bdf25ab43809d4 Mon Sep 17 00:00:00 2001 +From 5807870fbc69dcd107a2fac7ce58da052d5e7fea Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 5 Aug 2019 13:37:05 +0200 -Subject: [PATCH 17/38] hmac: Don't default to md5 in FIPS mode +Subject: [PATCH 15/36] hmac: Don't default to md5 in FIPS mode --- Lib/hmac.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/hmac.py b/Lib/hmac.py -index daabc8c142..0302364642 100644 +index daabc8c..0302364 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -173,7 +173,7 @@ def new(key, msg=None, digestmod=''): @@ -3093,10 +2832,10 @@ index daabc8c142..0302364642 100644 2.25.4 -From 074d6c62025226c381eb0191eddb86322be9d4f1 Mon Sep 17 00:00:00 2001 +From 04a69823b36ee8626aa74b40d5a631dd09759451 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 5 Aug 2019 14:20:58 +0200 -Subject: [PATCH 18/38] Make _hmacopenssl.HMAC subclassable; subclass it as +Subject: [PATCH 16/36] Make _hmacopenssl.HMAC subclassable; subclass it as hmac.HMAC under FIPS This removes the _hmacopenssl.new function. @@ -3108,7 +2847,7 @@ This removes the _hmacopenssl.new function. 4 files changed, 55 insertions(+), 87 deletions(-) diff --git a/Lib/hmac.py b/Lib/hmac.py -index 0302364642..e4222be7dc 100644 +index 0302364..e4222be 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -143,6 +143,8 @@ class HMAC: @@ -3159,7 +2898,7 @@ index 0302364642..e4222be7dc 100644 def digest(key, msg, digest): diff --git a/Lib/test/test_fips.py b/Lib/test/test_fips.py -index bee911ef40..34812e6098 100644 +index bee911e..34812e6 100644 --- a/Lib/test/test_fips.py +++ b/Lib/test/test_fips.py @@ -54,7 +54,7 @@ class HashlibFipsTests(unittest.TestCase): @@ -3172,7 +2911,7 @@ index bee911ef40..34812e6098 100644 diff --git a/Modules/_hmacopenssl.c b/Modules/_hmacopenssl.c -index 9c2882833d..7d3d9739f3 100644 +index 9c28828..7d3d973 100644 --- a/Modules/_hmacopenssl.c +++ b/Modules/_hmacopenssl.c @@ -41,33 +41,25 @@ typedef struct { @@ -3327,7 +3066,7 @@ index 9c2882833d..7d3d9739f3 100644 .m_size = sizeof(hmacopenssl_state), .m_traverse = hmacopenssl_traverse, diff --git a/Modules/clinic/_hmacopenssl.c.h b/Modules/clinic/_hmacopenssl.c.h -index b472a6eddd..861acc11bf 100644 +index b472a6e..861acc1 100644 --- a/Modules/clinic/_hmacopenssl.c.h +++ b/Modules/clinic/_hmacopenssl.c.h @@ -2,43 +2,6 @@ @@ -3384,17 +3123,17 @@ index b472a6eddd..861acc11bf 100644 2.25.4 -From 0cc9eab738876807a9116ee6fee57ac5757c1eb6 Mon Sep 17 00:00:00 2001 +From e0cbbc9dac64f173baa5348cf3608536ea8aea70 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 5 Aug 2019 16:10:36 +0200 -Subject: [PATCH 19/38] Fix _hmacopenssl.HMAC.block_size +Subject: [PATCH 17/36] Fix _hmacopenssl.HMAC.block_size --- Modules/_hmacopenssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_hmacopenssl.c b/Modules/_hmacopenssl.c -index 7d3d9739f3..a24c8ba022 100644 +index 7d3d973..a24c8ba 100644 --- a/Modules/_hmacopenssl.c +++ b/Modules/_hmacopenssl.c @@ -318,7 +318,7 @@ _hmacopenssl_get_block_size(HmacObject *self, void *closure) @@ -3410,10 +3149,10 @@ index 7d3d9739f3..a24c8ba022 100644 2.25.4 -From 79442a65e763d1942a14f52f8ceb83d51d39ca2b Mon Sep 17 00:00:00 2001 +From d90c5c55ad983d84b09b366d4b62f06aa535fad6 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 5 Aug 2019 15:02:08 +0200 -Subject: [PATCH 20/38] distutils upload: Skip md5 checksum in FIPS mode +Subject: [PATCH 18/36] distutils upload: Skip md5 checksum in FIPS mode --- Lib/distutils/command/upload.py | 12 +++++++++++- @@ -3421,7 +3160,7 @@ Subject: [PATCH 20/38] distutils upload: Skip md5 checksum in FIPS mode 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py -index 11afa24b77..79a6315a43 100644 +index 11afa24..79a6315 100644 --- a/Lib/distutils/command/upload.py +++ b/Lib/distutils/command/upload.py @@ -102,7 +102,6 @@ class upload(PyPIRCCommand): @@ -3451,7 +3190,7 @@ index 11afa24b77..79a6315a43 100644 if self.sign: diff --git a/Lib/distutils/tests/test_upload.py b/Lib/distutils/tests/test_upload.py -index c17d8e7d54..b4b64e9773 100644 +index c17d8e7..b4b64e9 100644 --- a/Lib/distutils/tests/test_upload.py +++ b/Lib/distutils/tests/test_upload.py @@ -3,6 +3,7 @@ import os @@ -3492,10 +3231,10 @@ index c17d8e7d54..b4b64e9773 100644 2.25.4 -From b37078729378cb7c0b93ab15da0b1e4343a0b976 Mon Sep 17 00:00:00 2001 +From 885f7b41697f252260a67d78ca8c46450843fa5e Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 5 Aug 2019 15:32:25 +0200 -Subject: [PATCH 21/38] Fix HMAC tests on FIPS mode +Subject: [PATCH 19/36] Fix HMAC tests on FIPS mode --- Lib/hmac.py | 3 +++ @@ -3503,7 +3242,7 @@ Subject: [PATCH 21/38] Fix HMAC tests on FIPS mode 2 files changed, 29 insertions(+) diff --git a/Lib/hmac.py b/Lib/hmac.py -index e4222be7dc..394c81037b 100644 +index e4222be..394c810 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -158,6 +158,9 @@ def _get_openssl_name(digestmod): @@ -3517,7 +3256,7 @@ index e4222be7dc..394c81037b 100644 result = _hmacopenssl.HMAC.__new__(cls, key, digestmod=name) if msg: diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py -index 23c108f6e3..0a859817f6 100644 +index 23c108f..0a85981 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -288,6 +288,7 @@ class TestVectorsTestCase(unittest.TestCase): @@ -3585,17 +3324,17 @@ index 23c108f6e3..0a859817f6 100644 2.25.4 -From 9481cec81e30e0dfaa988ade89c50bea91762856 Mon Sep 17 00:00:00 2001 +From 288d91b4752801264b37f7e94d964e1dffdee562 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 5 Aug 2019 16:37:12 +0200 -Subject: [PATCH 22/38] test_tools: Skip md5sum tests in FIPS mode +Subject: [PATCH 20/36] test_tools: Skip md5sum tests in FIPS mode --- Lib/test/test_tools/test_md5sum.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/test/test_tools/test_md5sum.py b/Lib/test/test_tools/test_md5sum.py -index fb565b7377..7028a4dc21 100644 +index fb565b7..7028a4d 100644 --- a/Lib/test/test_tools/test_md5sum.py +++ b/Lib/test/test_tools/test_md5sum.py @@ -4,11 +4,15 @@ import os @@ -3618,17 +3357,17 @@ index fb565b7377..7028a4dc21 100644 2.25.4 -From a12dec28f06338b7529da9bfeda2a8fe835395d2 Mon Sep 17 00:00:00 2001 +From 2c89b2e465e60558e0e066cc42a087ee6f31d520 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 5 Aug 2019 18:23:57 +0200 -Subject: [PATCH 23/38] Make hashlib tests pass in FIPS mode +Subject: [PATCH 21/36] Make hashlib tests pass in FIPS mode --- Lib/test/test_hashlib.py | 67 ++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py -index 2a55fd4309..9ae5efc451 100644 +index 2a55fd4..9ae5efc 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -28,6 +28,11 @@ COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') @@ -3813,10 +3552,10 @@ index 2a55fd4309..9ae5efc451 100644 2.25.4 -From 35ebfc357302e14372529a63334ca60cbec49b3e Mon Sep 17 00:00:00 2001 +From 14f26f4f378718024d0b0f300ab2f84429d23044 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Wed, 14 Aug 2019 14:43:07 +0200 -Subject: [PATCH 24/38] distutils upload: only add md5 if available, but +Subject: [PATCH 22/36] distutils upload: only add md5 if available, but *always* use sha256 --- @@ -3825,7 +3564,7 @@ Subject: [PATCH 24/38] distutils upload: only add md5 if available, but 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py -index 79a6315a43..553617a8d8 100644 +index 79a6315..553617a 100644 --- a/Lib/distutils/command/upload.py +++ b/Lib/distutils/command/upload.py @@ -102,6 +102,7 @@ class upload(PyPIRCCommand): @@ -3846,7 +3585,7 @@ index 79a6315a43..553617a8d8 100644 # this really shouldn't fail raise diff --git a/Lib/distutils/tests/test_upload.py b/Lib/distutils/tests/test_upload.py -index b4b64e9773..f720a7905d 100644 +index b4b64e9..f720a79 100644 --- a/Lib/distutils/tests/test_upload.py +++ b/Lib/distutils/tests/test_upload.py @@ -132,10 +132,11 @@ class uploadTestCase(BasePyPIRCCommandTestCase): @@ -3883,10 +3622,10 @@ index b4b64e9773..f720a7905d 100644 2.25.4 -From 36204b47f4f48d4be8e4772f4ab8fc39ca98934b Mon Sep 17 00:00:00 2001 +From 24e57cc45dc18146a583257e5825d6b6e672742d Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 13 Sep 2019 02:30:00 +0200 -Subject: [PATCH 25/38] bpo-9216: Add usedforsecurity to hashlib constructors +Subject: [PATCH 23/36] bpo-9216: Add usedforsecurity to hashlib constructors (GH-16044) The usedforsecurity keyword only argument added to the hash constructors is useful for FIPS builds and similar restrictive environment with non-technical requirements that legacy algorithms be forbidden by their implementations without being explicitly annotated as not being used for any security related purposes. Linux distros with FIPS support benefit from this being standard rather than making up their own way(s) to do it. @@ -3917,7 +3656,7 @@ Contributed and Signed-off-by: Christian Heimes christian@python.org create mode 100644 Misc/NEWS.d/next/Library/2019-09-12-14-54-45.bpo-9216.W7QMpC.rst diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst -index a16c7cd4d7..6eb3a7bb4c 100644 +index a16c7cd..6eb3a7b 100644 --- a/Doc/library/hashlib.rst +++ b/Doc/library/hashlib.rst @@ -67,7 +67,7 @@ Constructors for hash algorithms that are always present in this module are @@ -3969,7 +3708,7 @@ index a16c7cd4d7..6eb3a7bb4c 100644 These functions return the corresponding hash objects for calculating diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py -index 9ae5efc451..08bb91f27b 100644 +index 9ae5efc..08bb91f 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -226,6 +226,15 @@ class HashLibTestCase(unittest.TestCase): @@ -3989,7 +3728,7 @@ index 9ae5efc451..08bb91f27b 100644 self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam') self.assertRaises(TypeError, hashlib.new, 1) diff --git a/Lib/uuid.py b/Lib/uuid.py -index 188e16ba14..5f3bc9e8de 100644 +index 188e16b..5f3bc9e 100644 --- a/Lib/uuid.py +++ b/Lib/uuid.py @@ -772,8 +772,11 @@ def uuid1(node=None, clock_seq=None): @@ -4008,14 +3747,14 @@ index 188e16ba14..5f3bc9e8de 100644 """Generate a random UUID.""" diff --git a/Misc/NEWS.d/next/Library/2019-09-12-14-54-45.bpo-9216.W7QMpC.rst b/Misc/NEWS.d/next/Library/2019-09-12-14-54-45.bpo-9216.W7QMpC.rst new file mode 100644 -index 0000000000..a97ca4b8b4 +index 0000000..a97ca4b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-09-12-14-54-45.bpo-9216.W7QMpC.rst @@ -0,0 +1,2 @@ +hashlib constructors now support usedforsecurity flag to signal that a +hashing algorithm is not used in a security context. diff --git a/Modules/_blake2/blake2b_impl.c b/Modules/_blake2/blake2b_impl.c -index 97ce89d33c..16df232793 100644 +index 97ce89d..16df232 100644 --- a/Modules/_blake2/blake2b_impl.c +++ b/Modules/_blake2/blake2b_impl.c @@ -82,6 +82,7 @@ _blake2.blake2b.__new__ as py_blake2b_new @@ -4038,7 +3777,7 @@ index 97ce89d33c..16df232793 100644 BLAKE2bObject *self = NULL; Py_buffer buf; diff --git a/Modules/_blake2/blake2s_impl.c b/Modules/_blake2/blake2s_impl.c -index c4447b4fe8..66a7ee567d 100644 +index c4447b4..66a7ee5 100644 --- a/Modules/_blake2/blake2s_impl.c +++ b/Modules/_blake2/blake2s_impl.c @@ -82,6 +82,7 @@ _blake2.blake2s.__new__ as py_blake2s_new @@ -4061,7 +3800,7 @@ index c4447b4fe8..66a7ee567d 100644 BLAKE2sObject *self = NULL; Py_buffer buf; diff --git a/Modules/_blake2/clinic/blake2b_impl.c.h b/Modules/_blake2/clinic/blake2b_impl.c.h -index cd329c07c9..07258c31c9 100644 +index cd329c0..07258c3 100644 --- a/Modules/_blake2/clinic/blake2b_impl.c.h +++ b/Modules/_blake2/clinic/blake2b_impl.c.h @@ -5,7 +5,8 @@ preserve @@ -4133,7 +3872,7 @@ index cd329c07c9..07258c31c9 100644 -/*[clinic end generated code: output=cbb625d7f60c288c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2d6d0fe9aa42a42a input=a9049054013a1b77]*/ diff --git a/Modules/_blake2/clinic/blake2s_impl.c.h b/Modules/_blake2/clinic/blake2s_impl.c.h -index 560bd68160..71c5706fb6 100644 +index 560bd68..71c5706 100644 --- a/Modules/_blake2/clinic/blake2s_impl.c.h +++ b/Modules/_blake2/clinic/blake2s_impl.c.h @@ -5,7 +5,8 @@ preserve @@ -4205,7 +3944,7 @@ index 560bd68160..71c5706fb6 100644 -/*[clinic end generated code: output=39af5a74c8805b36 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c80d8d06ce40a192 input=a9049054013a1b77]*/ diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c -index 625e2d2e8f..8d0c7de2b2 100644 +index e10dbd7..29c1bd8 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -517,7 +517,7 @@ static PyTypeObject EVPtype = { @@ -4605,7 +4344,7 @@ index 625e2d2e8f..8d0c7de2b2 100644 diff --git a/Modules/_sha3/clinic/sha3module.c.h b/Modules/_sha3/clinic/sha3module.c.h -index 554442df0e..1c79c26939 100644 +index 554442d..1c79c26 100644 --- a/Modules/_sha3/clinic/sha3module.c.h +++ b/Modules/_sha3/clinic/sha3module.c.h @@ -2,6 +2,52 @@ @@ -4668,7 +4407,7 @@ index 554442df0e..1c79c26939 100644 -/*[clinic end generated code: output=5b3e99b9a96471e8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c8a97b34e80def62 input=a9049054013a1b77]*/ diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c -index 3079e1e3a4..fc8b1b262a 100644 +index 3079e1e..fc8b1b2 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -171,22 +171,25 @@ newSHA3object(PyTypeObject *type) @@ -4776,7 +4515,7 @@ index 3079e1e3a4..fc8b1b262a 100644 Return a new SHAKE hash object."); diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h -index e96a752e27..967884727b 100644 +index e96a752..9678847 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -66,7 +66,7 @@ PyDoc_STRVAR(EVP_update__doc__, @@ -5628,7 +5367,7 @@ index e96a752e27..967884727b 100644 -/*[clinic end generated code: output=be8e21a10dff71e7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3db4f18f12892fa4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h -index 12484cc0e3..c109f9efec 100644 +index 12484cc..c109f9e 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -66,7 +66,7 @@ PyDoc_STRVAR(MD5Type_update__doc__, @@ -5691,7 +5430,7 @@ index 12484cc0e3..c109f9efec 100644 -/*[clinic end generated code: output=53133f08cf9095fc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dbe3abc60086f3ef input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h -index 001c6af737..fc37b1ab88 100644 +index 001c6af..fc37b1a 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -66,7 +66,7 @@ PyDoc_STRVAR(SHA1Type_update__doc__, @@ -5754,7 +5493,7 @@ index 001c6af737..fc37b1ab88 100644 -/*[clinic end generated code: output=1ae7e73ec84a27d5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3ddd637ae17e14b3 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha256module.c.h b/Modules/clinic/sha256module.c.h -index 658abb15cf..2a788ea984 100644 +index 658abb1..2a788ea 100644 --- a/Modules/clinic/sha256module.c.h +++ b/Modules/clinic/sha256module.c.h @@ -66,7 +66,7 @@ PyDoc_STRVAR(SHA256Type_update__doc__, @@ -5872,7 +5611,7 @@ index 658abb15cf..2a788ea984 100644 -/*[clinic end generated code: output=c54d0956ec88409d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c8cca8adbe72ec9a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/sha512module.c.h b/Modules/clinic/sha512module.c.h -index 459a9341cf..b8185b62bb 100644 +index 459a934..b8185b6 100644 --- a/Modules/clinic/sha512module.c.h +++ b/Modules/clinic/sha512module.c.h @@ -66,7 +66,7 @@ PyDoc_STRVAR(SHA512Type_update__doc__, @@ -5990,7 +5729,7 @@ index 459a9341cf..b8185b62bb 100644 -/*[clinic end generated code: output=580df4b667084a7e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bbfa72d8703c82b5 input=a9049054013a1b77]*/ diff --git a/Modules/md5module.c b/Modules/md5module.c -index b9a351a8c1..f2c2d32cbe 100644 +index b9a351a..f2c2d32 100644 --- a/Modules/md5module.c +++ b/Modules/md5module.c @@ -503,13 +503,15 @@ static PyTypeObject MD5type = { @@ -6012,7 +5751,7 @@ index b9a351a8c1..f2c2d32cbe 100644 MD5object *new; Py_buffer buf; diff --git a/Modules/sha1module.c b/Modules/sha1module.c -index ce2ad267e7..4d191c3c48 100644 +index ce2ad26..4d191c3 100644 --- a/Modules/sha1module.c +++ b/Modules/sha1module.c @@ -480,13 +480,15 @@ static PyTypeObject SHA1type = { @@ -6034,7 +5773,7 @@ index ce2ad267e7..4d191c3c48 100644 SHA1object *new; Py_buffer buf; diff --git a/Modules/sha256module.c b/Modules/sha256module.c -index b8d6c4cf80..245f4c0454 100644 +index b8d6c4c..245f4c0 100644 --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -601,13 +601,15 @@ static PyTypeObject SHA256type = { @@ -6074,7 +5813,7 @@ index b8d6c4cf80..245f4c0454 100644 SHAobject *new; Py_buffer buf; diff --git a/Modules/sha512module.c b/Modules/sha512module.c -index 98b97917f4..df4f9d2d74 100644 +index 98b9791..df4f9d2 100644 --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -666,13 +666,15 @@ static PyTypeObject SHA512type = { @@ -6117,17 +5856,17 @@ index 98b97917f4..df4f9d2d74 100644 2.25.4 -From aed5f603fda874d823ca04b562c8289bfa42d8f3 Mon Sep 17 00:00:00 2001 +From 372b2b63bf8ffb3201dc3c8d2488f6a5a55c5b21 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 26 Aug 2019 19:09:39 +0200 -Subject: [PATCH 26/38] Test the usedforsecurity flag +Subject: [PATCH 24/36] Test the usedforsecurity flag --- Lib/test/test_hashlib.py | 88 ++++++++++++++++++++++++---------------- 1 file changed, 54 insertions(+), 34 deletions(-) diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py -index 08bb91f27b..1368e91708 100644 +index 08bb91f..1368e91 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -21,6 +21,7 @@ from test import support @@ -6363,10 +6102,10 @@ index 08bb91f27b..1368e91708 100644 2.25.4 -From fa3ce5149806b1ef588b75681147636d55c5c604 Mon Sep 17 00:00:00 2001 +From 7e2295b42d705d7d9cc0ccea472ff93bfa268b8c Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 29 Aug 2019 10:25:28 +0200 -Subject: [PATCH 27/38] Skip error checking in _hashlib.get_fips_mode +Subject: [PATCH 25/36] Skip error checking in _hashlib.get_fips_mode Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1745499 --- @@ -6374,7 +6113,7 @@ Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1745499 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c -index 8d0c7de2b2..ed92514e78 100644 +index 29c1bd8..d208f5c 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -1249,20 +1249,22 @@ _hashlib_get_fips_mode_impl(PyObject *module) @@ -6418,10 +6157,10 @@ index 8d0c7de2b2..ed92514e78 100644 2.25.4 -From 282056eda492073e9e03904e8a513547fe2b9836 Mon Sep 17 00:00:00 2001 +From dd5f58152edbcac44bcb1cafbee511c44d60ff67 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 10 Oct 2019 13:04:50 +0200 -Subject: [PATCH 28/38] Skip error checking in _Py_hashlib_fips_error +Subject: [PATCH 26/36] Skip error checking in _Py_hashlib_fips_error https://bugzilla.redhat.com/show_bug.cgi?id=1760106 --- @@ -6429,7 +6168,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1760106 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Include/_hashopenssl.h b/Include/_hashopenssl.h -index 47ed003042..d4cbdef984 100644 +index 47ed003..d4cbdef 100644 --- a/Include/_hashopenssl.h +++ b/Include/_hashopenssl.h @@ -42,16 +42,10 @@ static int @@ -6456,10 +6195,10 @@ index 47ed003042..d4cbdef984 100644 2.25.4 -From 6c5a3b45f7754e7d19084794f573189ba38a00fa Mon Sep 17 00:00:00 2001 +From c76f0df2561ae64952f347d294aec2866e6b0586 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 5 Aug 2019 19:12:38 +0200 -Subject: [PATCH 29/38] Fixups +Subject: [PATCH 27/36] Fixups - Adjust error message of the original hmac.HMAC class - Don't duplicate a test name @@ -6469,7 +6208,7 @@ Subject: [PATCH 29/38] Fixups 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/hmac.py b/Lib/hmac.py -index 394c81037b..b2bff7d975 100644 +index 394c810..b2bff7d 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -47,7 +47,7 @@ class HMAC: @@ -6482,7 +6221,7 @@ index 394c81037b..b2bff7d975 100644 ) diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py -index 0a859817f6..0b481ec9c0 100644 +index 0a85981..0b481ec 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -439,7 +439,7 @@ class CopyTestCase(unittest.TestCase): @@ -6498,10 +6237,10 @@ index 0a859817f6..0b481ec9c0 100644 2.25.4 -From 63426a2f6c7904800094db9fd3476a5d4711ad25 Mon Sep 17 00:00:00 2001 +From b6139620fa7aaf401ebd510a0dbca14629096f94 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 26 Aug 2019 19:39:48 +0200 -Subject: [PATCH 30/38] Don't re-export get_fips_mode from hashlib +Subject: [PATCH 28/36] Don't re-export get_fips_mode from hashlib Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1745685 --- @@ -6518,7 +6257,7 @@ Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1745685 10 files changed, 41 insertions(+), 32 deletions(-) diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py -index 553617a8d8..8653caefc9 100644 +index 553617a..8653cae 100644 --- a/Lib/distutils/command/upload.py +++ b/Lib/distutils/command/upload.py @@ -127,7 +127,8 @@ class upload(PyPIRCCommand): @@ -6532,7 +6271,7 @@ index 553617a8d8..8653caefc9 100644 raise else: diff --git a/Lib/distutils/tests/test_upload.py b/Lib/distutils/tests/test_upload.py -index f720a7905d..a198b21357 100644 +index f720a79..a198b21 100644 --- a/Lib/distutils/tests/test_upload.py +++ b/Lib/distutils/tests/test_upload.py @@ -4,6 +4,7 @@ import unittest @@ -6562,7 +6301,7 @@ index f720a7905d..a198b21357 100644 self.assertEqual(headers['Content-length'], '2207') else: diff --git a/Lib/hashlib.py b/Lib/hashlib.py -index 898e6dca56..2fc214e7ef 100644 +index 898e6dc..2fc214e 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -76,12 +76,12 @@ __block_openssl_constructor = { @@ -6644,7 +6383,7 @@ index 898e6dca56..2fc214e7ef 100644 del __py_new +del _hashlib_get_fips_mode diff --git a/Lib/hmac.py b/Lib/hmac.py -index b2bff7d975..5055027bbb 100644 +index b2bff7d..5055027 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -45,7 +45,7 @@ class HMAC: @@ -6675,7 +6414,7 @@ index b2bff7d975..5055027bbb 100644 diff --git a/Lib/test/test_fips.py b/Lib/test/test_fips.py -index 34812e6098..86e61e29c0 100644 +index 34812e6..86e61e2 100644 --- a/Lib/test/test_fips.py +++ b/Lib/test/test_fips.py @@ -6,7 +6,7 @@ import hashlib, _hashlib @@ -6706,7 +6445,7 @@ index 34812e6098..86e61e29c0 100644 self.compare_hashes(hashlib.shake_128(b'abc'), _hashlib.openssl_shake_128(b'abc')) self.compare_hashes(hashlib.shake_256(b'abc'), _hashlib.openssl_shake_256(b'abc')) diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py -index 1368e91708..a4b78406a5 100644 +index 1368e91..a4b7840 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -29,7 +29,9 @@ COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') @@ -6772,7 +6511,7 @@ index 1368e91708..a4b78406a5 100644 """Make sure usedforsecurity flag isn't copied to other contexts""" for i in range(3): diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py -index 0b481ec9c0..cc77928fa3 100644 +index 0b481ec..cc77928 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -5,6 +5,7 @@ import hashlib @@ -6811,7 +6550,7 @@ index 0b481ec9c0..cc77928fa3 100644 def test_realcopy(self): # Testing if the copy method created a real copy. diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py -index d0c9862ede..9a44c0dc7a 100644 +index d0c9862..9a44c0d 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -17,6 +17,8 @@ import select @@ -6833,7 +6572,7 @@ index d0c9862ede..9a44c0dc7a 100644 resp = smtp.login(sim_auth[0], sim_auth[1]) self.assertEqual(resp, (235, b'Authentication Succeeded')) diff --git a/Lib/test/test_tools/test_md5sum.py b/Lib/test/test_tools/test_md5sum.py -index 7028a4dc21..3ba1ca0f14 100644 +index 7028a4d..3ba1ca0 100644 --- a/Lib/test/test_tools/test_md5sum.py +++ b/Lib/test/test_tools/test_md5sum.py @@ -4,13 +4,13 @@ import os @@ -6853,7 +6592,7 @@ index 7028a4dc21..3ba1ca0f14 100644 class MD5SumTests(unittest.TestCase): diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py -index 1cb358f8dd..6f5cb7fcd1 100644 +index 1cb358f..6f5cb7f 100644 --- a/Lib/test/test_urllib2_localnet.py +++ b/Lib/test/test_urllib2_localnet.py @@ -7,6 +7,7 @@ import http.server @@ -6868,10 +6607,10 @@ index 1cb358f8dd..6f5cb7fcd1 100644 2.25.4 -From a8f87fa94aae8f8ed05607974e2bd30c54d3f3ce Mon Sep 17 00:00:00 2001 +From 1de6c9e0e86e5c661ae32517492ecdf79a372e52 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Wed, 20 Nov 2019 10:59:25 +0100 -Subject: [PATCH 31/38] Use FIPS compliant CSPRNG +Subject: [PATCH 29/36] Use FIPS compliant CSPRNG Kernel's getrandom() source is not yet FIPS compliant. Use OpenSSL's DRBG in FIPS mode and disable os.getrandom() function. @@ -6885,7 +6624,7 @@ Signed-off-by: Christian Heimes 4 files changed, 89 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py -index 4a076e3bbf..f60ad6ddbd 100644 +index 4a076e3..f60ad6d 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1546,6 +1546,11 @@ class GetRandomTests(unittest.TestCase): @@ -6901,7 +6640,7 @@ index 4a076e3bbf..f60ad6ddbd 100644 def test_getrandom_type(self): data = os.getrandom(16) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 502317aa0c..924367d2ad 100644 +index 72d202d..9c34f99 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -116,7 +116,7 @@ PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFOR @@ -6914,7 +6653,7 @@ index 502317aa0c..924367d2ad 100644 CFLAGS_ALIASING=@CFLAGS_ALIASING@ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index b09204d633..99d1dca118 100644 +index 850769f..039392e 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -388,6 +388,9 @@ extern char *ctermid_r(char *); @@ -6940,7 +6679,7 @@ index b09204d633..99d1dca118 100644 if (bytes == NULL) { PyErr_NoMemory(); diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c -index 43f5264d86..67166475a7 100644 +index 43f5264..6716647 100644 --- a/Python/bootstrap_hash.c +++ b/Python/bootstrap_hash.c @@ -409,6 +409,77 @@ dev_urandom_close(void) @@ -7036,10 +6775,10 @@ index 43f5264d86..67166475a7 100644 2.25.4 -From 5539f0001fb2785c2d2feea97fc2a910ca954f92 Mon Sep 17 00:00:00 2001 +From 2af1274a6f6f7eb7aeb106007fd62e9fc889a86e Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 28 Nov 2019 17:26:02 +0100 -Subject: [PATCH 32/38] Fixups for FIPS compliant CSPRNG +Subject: [PATCH 30/36] Fixups for FIPS compliant CSPRNG --- Lib/test/test_os.py | 3 ++- @@ -7047,7 +6786,7 @@ Subject: [PATCH 32/38] Fixups for FIPS compliant CSPRNG 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py -index f60ad6ddbd..be057ad3a3 100644 +index f60ad6d..be057ad 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -28,6 +28,7 @@ import time @@ -7068,7 +6807,7 @@ index f60ad6ddbd..be057ad3a3 100644 else: raise diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c -index 67166475a7..7466d5fb5c 100644 +index 6716647..7466d5f 100644 --- a/Python/bootstrap_hash.c +++ b/Python/bootstrap_hash.c @@ -409,40 +409,13 @@ dev_urandom_close(void) @@ -7135,10 +6874,10 @@ index 67166475a7..7466d5fb5c 100644 2.25.4 -From 0751459de22c1c3eb57d97a69943fd55894e4e37 Mon Sep 17 00:00:00 2001 +From 17c962efe979581d12e1cf80a04b9538bdfe7c45 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 2 Apr 2020 16:50:37 +0200 -Subject: [PATCH 33/38] Do not raise a ValueError if digestmod is missing in +Subject: [PATCH 31/36] Do not raise a ValueError if digestmod is missing in FIPS Python 3.8 already requires the digestmod argument and raises @@ -7149,7 +6888,7 @@ for it. 1 file changed, 2 deletions(-) diff --git a/Lib/hmac.py b/Lib/hmac.py -index 5055027bbb..ee1ad76d22 100644 +index 5055027..ee1ad76 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -143,8 +143,6 @@ class HMAC: @@ -7165,10 +6904,10 @@ index 5055027bbb..ee1ad76d22 100644 2.25.4 -From 2a6b2ddb41afbca4d27b22dff6efe1e29628ad10 Mon Sep 17 00:00:00 2001 +From 4acd1c8665231881335b6036a8595ac3220c0220 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 2 Apr 2020 16:55:36 +0200 -Subject: [PATCH 34/38] Regenerate the clinic files +Subject: [PATCH 32/36] Regenerate the clinic files --- Modules/_hmacopenssl.c | 4 ++-- @@ -7176,7 +6915,7 @@ Subject: [PATCH 34/38] Regenerate the clinic files 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Modules/_hmacopenssl.c b/Modules/_hmacopenssl.c -index a24c8ba022..9577cadf93 100644 +index a24c8ba..9577cad 100644 --- a/Modules/_hmacopenssl.c +++ b/Modules/_hmacopenssl.c @@ -132,12 +132,12 @@ error: @@ -7195,7 +6934,7 @@ index a24c8ba022..9577cadf93 100644 HmacObject *retval; diff --git a/Modules/clinic/_hmacopenssl.c.h b/Modules/clinic/_hmacopenssl.c.h -index 861acc11bf..527be832bf 100644 +index 861acc1..527be83 100644 --- a/Modules/clinic/_hmacopenssl.c.h +++ b/Modules/clinic/_hmacopenssl.c.h @@ -6,7 +6,7 @@ PyDoc_STRVAR(_hmacopenssl_HMAC_copy__doc__, @@ -7252,17 +6991,17 @@ index 861acc11bf..527be832bf 100644 2.25.4 -From c3c02457dd542ce6b9f4b1f731fc931319d16feb Mon Sep 17 00:00:00 2001 +From 900bbdc1e2d9498829731da4591f1ea4a5602fa4 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 7 Apr 2020 15:16:45 +0200 -Subject: [PATCH 35/38] Pass kwargs (like usedforsecurity) through __hash_new +Subject: [PATCH 33/36] Pass kwargs (like usedforsecurity) through __hash_new --- Lib/hashlib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/hashlib.py b/Lib/hashlib.py -index 2fc214e7ef..785858ff8e 100644 +index 2fc214e..785858f 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -169,7 +169,7 @@ def __hash_new(name, data=b'', **kwargs): @@ -7287,10 +7026,10 @@ index 2fc214e7ef..785858ff8e 100644 2.25.4 -From 84d589fae710f7e53621f24e555c30d1a2445243 Mon Sep 17 00:00:00 2001 +From ab62e35c2c3a71b2ff50098966e654c91fb861d0 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 7 Apr 2020 15:18:48 +0200 -Subject: [PATCH 36/38] Adjust new upstream test for failing hashes with +Subject: [PATCH 34/36] Adjust new upstream test for failing hashes with usedforsecurity --- @@ -7298,7 +7037,7 @@ Subject: [PATCH 36/38] Adjust new upstream test for failing hashes with 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py -index a4b78406a5..a858bf4c59 100644 +index a4b7840..a858bf4 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -239,15 +239,23 @@ class HashLibTestCase(unittest.TestCase): @@ -7333,10 +7072,10 @@ index a4b78406a5..a858bf4c59 100644 2.25.4 -From f0e979a69644f4ff3a1743b215a1a174fd286f22 Mon Sep 17 00:00:00 2001 +From 2b6bf1615e9e04a688f622e4b45e0e062a09578f Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 24 Apr 2020 19:57:16 +0200 -Subject: [PATCH 37/38] Skip the test_with_digestmod_no_default under FIPS +Subject: [PATCH 35/36] Skip the test_with_digestmod_no_default under FIPS Also add a new test for testing the error values of the digestmod parameter misuse under FIPS mode. @@ -7345,7 +7084,7 @@ the digestmod parameter misuse under FIPS mode. 1 file changed, 13 insertions(+) diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py -index cc77928fa3..fd068e0229 100644 +index cc77928..fd068e0 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -313,6 +313,7 @@ class TestVectorsTestCase(unittest.TestCase): @@ -7379,10 +7118,10 @@ index cc77928fa3..fd068e0229 100644 2.25.4 -From f0eeed021d17a891c8cac5cc140e4a359027b314 Mon Sep 17 00:00:00 2001 +From 65903540be85cbd6f188f6b5e69431859d0cbc0e Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 31 Mar 2020 18:00:42 +0200 -Subject: [PATCH 38/38] Add a sentinel value on the Hmac_members table of the +Subject: [PATCH 36/36] Add a sentinel value on the Hmac_members table of the hmac module --- @@ -7390,7 +7129,7 @@ Subject: [PATCH 38/38] Add a sentinel value on the Hmac_members table of the 1 file changed, 1 insertion(+) diff --git a/Modules/_hmacopenssl.c b/Modules/_hmacopenssl.c -index 9577cadf93..4bd7c1533f 100644 +index 9577cad..4bd7c15 100644 --- a/Modules/_hmacopenssl.c +++ b/Modules/_hmacopenssl.c @@ -337,6 +337,7 @@ static PyGetSetDef Hmac_getset[] = { diff --git a/SOURCES/00337-test_ssl-test_min_max_version-add-range.patch b/SOURCES/00337-test_ssl-test_min_max_version-add-range.patch deleted file mode 100644 index df60a01..0000000 --- a/SOURCES/00337-test_ssl-test_min_max_version-add-range.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 4e4445efad2d3aa17b455a2683884e500d1a7c90 Mon Sep 17 00:00:00 2001 -From: Tomas Orsava -Date: Fri, 29 Nov 2019 16:07:27 +0100 -Subject: [PATCH] Adjust the test_min_max_version in test_ssl - -to accept the new settings in RHEL 8.2 where maximum_version is set to TLS 1.3. ---- - Lib/test/test_ssl.py | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py -index 419506f..c9b2cf9 100644 ---- a/Lib/test/test_ssl.py -+++ b/Lib/test/test_ssl.py -@@ -1200,12 +1200,18 @@ class ContextTests(unittest.TestCase): - # RHEL 8 uses TLS 1.2 by default - ssl.TLSVersion.TLSv1_2 - } -+ maximum_range = { -+ # stock OpenSSL -+ ssl.TLSVersion.MAXIMUM_SUPPORTED, -+ # RHEL 8.2 requires maximum TLS 1.3 -+ ssl.TLSVersion.TLSv1_3 -+ } - - self.assertIn( - ctx.minimum_version, minimum_range - ) -- self.assertEqual( -- ctx.maximum_version, ssl.TLSVersion.MAXIMUM_SUPPORTED -+ self.assertIn( -+ ctx.maximum_version, maximum_range - ) - - ctx.minimum_version = ssl.TLSVersion.TLSv1_1 --- -2.20.1 - diff --git a/SOURCES/00345-fix-test_site-with-extra-pth-files.patch b/SOURCES/00345-fix-test_site-with-extra-pth-files.patch deleted file mode 100644 index 4f3ad08..0000000 --- a/SOURCES/00345-fix-test_site-with-extra-pth-files.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py -index d0cd84f..9d2c28c 100644 ---- a/Lib/test/test_site.py -+++ b/Lib/test/test_site.py -@@ -10,6 +10,7 @@ from test import support - from test.support import (captured_stderr, TESTFN, EnvironmentVarGuard, - change_cwd) - import builtins -+import glob - import os - import sys - import re -@@ -500,6 +501,23 @@ class ImportSideEffectTests(unittest.TestCase): - class StartupImportTests(unittest.TestCase): - - def test_startup_imports(self): -+ # Get sys.path in isolated mode (python3 -I) -+ popen = subprocess.Popen([sys.executable, '-I', '-c', -+ 'import sys; print(repr(sys.path))'], -+ stdout=subprocess.PIPE, -+ encoding='utf-8') -+ stdout = popen.communicate()[0] -+ self.assertEqual(popen.returncode, 0, repr(stdout)) -+ isolated_paths = eval(stdout) -+ -+ # bpo-27807: Even with -I, the site module executes all .pth files -+ # found in sys.path (see site.addpackage()). Skip the test if at least -+ # one .pth file is found. -+ for path in isolated_paths: -+ pth_files = glob.glob(os.path.join(path, "*.pth")) -+ if pth_files: -+ self.skipTest(f"found {len(pth_files)} .pth files in: {path}") -+ - # This tests checks which modules are loaded by Python when it - # initially starts upon startup. - popen = subprocess.Popen([sys.executable, '-I', '-v', '-c', -@@ -508,6 +526,7 @@ class StartupImportTests(unittest.TestCase): - stderr=subprocess.PIPE, - encoding='utf-8') - stdout, stderr = popen.communicate() -+ self.assertEqual(popen.returncode, 0, (stdout, stderr)) - modules = eval(stdout) - - self.assertIn('site', modules) diff --git a/SOURCES/00346-CVE-2020-8492.patch b/SOURCES/00346-CVE-2020-8492.patch deleted file mode 100644 index 6738b0b..0000000 --- a/SOURCES/00346-CVE-2020-8492.patch +++ /dev/null @@ -1,193 +0,0 @@ -diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py -index 61e3ecc..091b397 100644 ---- a/Lib/test/test_urllib2.py -+++ b/Lib/test/test_urllib2.py -@@ -1444,40 +1444,64 @@ class HandlerTests(unittest.TestCase): - bypass = {'exclude_simple': True, 'exceptions': []} - self.assertTrue(_proxy_bypass_macosx_sysconf('test', bypass)) - -- def test_basic_auth(self, quote_char='"'): -- opener = OpenerDirector() -- password_manager = MockPasswordManager() -- auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) -- realm = "ACME Widget Store" -- http_handler = MockHTTPHandler( -- 401, 'WWW-Authenticate: Basic realm=%s%s%s\r\n\r\n' % -- (quote_char, realm, quote_char)) -- opener.add_handler(auth_handler) -- opener.add_handler(http_handler) -- self._test_basic_auth(opener, auth_handler, "Authorization", -- realm, http_handler, password_manager, -- "http://acme.example.com/protected", -- "http://acme.example.com/protected", -- ) -- -- def test_basic_auth_with_single_quoted_realm(self): -- self.test_basic_auth(quote_char="'") -- -- def test_basic_auth_with_unquoted_realm(self): -- opener = OpenerDirector() -- password_manager = MockPasswordManager() -- auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) -- realm = "ACME Widget Store" -- http_handler = MockHTTPHandler( -- 401, 'WWW-Authenticate: Basic realm=%s\r\n\r\n' % realm) -- opener.add_handler(auth_handler) -- opener.add_handler(http_handler) -- with self.assertWarns(UserWarning): -+ def check_basic_auth(self, headers, realm): -+ with self.subTest(realm=realm, headers=headers): -+ opener = OpenerDirector() -+ password_manager = MockPasswordManager() -+ auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) -+ body = '\r\n'.join(headers) + '\r\n\r\n' -+ http_handler = MockHTTPHandler(401, body) -+ opener.add_handler(auth_handler) -+ opener.add_handler(http_handler) - self._test_basic_auth(opener, auth_handler, "Authorization", -- realm, http_handler, password_manager, -- "http://acme.example.com/protected", -- "http://acme.example.com/protected", -- ) -+ realm, http_handler, password_manager, -+ "http://acme.example.com/protected", -+ "http://acme.example.com/protected") -+ -+ def test_basic_auth(self): -+ realm = "realm2@example.com" -+ realm2 = "realm2@example.com" -+ basic = f'Basic realm="{realm}"' -+ basic2 = f'Basic realm="{realm2}"' -+ other_no_realm = 'Otherscheme xxx' -+ digest = (f'Digest realm="{realm2}", ' -+ f'qop="auth, auth-int", ' -+ f'nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", ' -+ f'opaque="5ccc069c403ebaf9f0171e9517f40e41"') -+ for realm_str in ( -+ # test "quote" and 'quote' -+ f'Basic realm="{realm}"', -+ f"Basic realm='{realm}'", -+ -+ # charset is ignored -+ f'Basic realm="{realm}", charset="UTF-8"', -+ -+ # Multiple challenges per header -+ f'{basic}, {basic2}', -+ f'{basic}, {other_no_realm}', -+ f'{other_no_realm}, {basic}', -+ f'{basic}, {digest}', -+ f'{digest}, {basic}', -+ ): -+ headers = [f'WWW-Authenticate: {realm_str}'] -+ self.check_basic_auth(headers, realm) -+ -+ # no quote: expect a warning -+ with support.check_warnings(("Basic Auth Realm was unquoted", -+ UserWarning)): -+ headers = [f'WWW-Authenticate: Basic realm={realm}'] -+ self.check_basic_auth(headers, realm) -+ -+ # Multiple headers: one challenge per header. -+ # Use the first Basic realm. -+ for challenges in ( -+ [basic, basic2], -+ [basic, digest], -+ [digest, basic], -+ ): -+ headers = [f'WWW-Authenticate: {challenge}' -+ for challenge in challenges] -+ self.check_basic_auth(headers, realm) - - def test_proxy_basic_auth(self): - opener = OpenerDirector() -diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py -index 92c6a5d..675b2e3 100644 ---- a/Lib/urllib/request.py -+++ b/Lib/urllib/request.py -@@ -945,8 +945,15 @@ class AbstractBasicAuthHandler: - - # allow for double- and single-quoted realm values - # (single quotes are a violation of the RFC, but appear in the wild) -- rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+' -- 'realm=(["\']?)([^"\']*)\\2', re.I) -+ rx = re.compile('(?:^|,)' # start of the string or ',' -+ '[ \t]*' # optional whitespaces -+ '([^ \t]+)' # scheme like "Basic" -+ '[ \t]+' # mandatory whitespaces -+ # realm=xxx -+ # realm='xxx' -+ # realm="xxx" -+ 'realm=(["\']?)([^"\']*)\\2', -+ re.I) - - # XXX could pre-emptively send auth info already accepted (RFC 2617, - # end of section 2, and section 1.2 immediately after "credentials" -@@ -958,27 +965,51 @@ class AbstractBasicAuthHandler: - self.passwd = password_mgr - self.add_password = self.passwd.add_password - -+ def _parse_realm(self, header): -+ # parse WWW-Authenticate header: accept multiple challenges per header -+ found_challenge = False -+ for mo in AbstractBasicAuthHandler.rx.finditer(header): -+ scheme, quote, realm = mo.groups() -+ if quote not in ['"', "'"]: -+ warnings.warn("Basic Auth Realm was unquoted", -+ UserWarning, 3) -+ -+ yield (scheme, realm) -+ -+ found_challenge = True -+ -+ if not found_challenge: -+ if header: -+ scheme = header.split()[0] -+ else: -+ scheme = '' -+ yield (scheme, None) -+ - def http_error_auth_reqed(self, authreq, host, req, headers): - # host may be an authority (without userinfo) or a URL with an - # authority -- # XXX could be multiple headers -- authreq = headers.get(authreq, None) -+ headers = headers.get_all(authreq) -+ if not headers: -+ # no header found -+ return - -- if authreq: -- scheme = authreq.split()[0] -- if scheme.lower() != 'basic': -- raise ValueError("AbstractBasicAuthHandler does not" -- " support the following scheme: '%s'" % -- scheme) -- else: -- mo = AbstractBasicAuthHandler.rx.search(authreq) -- if mo: -- scheme, quote, realm = mo.groups() -- if quote not in ['"',"'"]: -- warnings.warn("Basic Auth Realm was unquoted", -- UserWarning, 2) -- if scheme.lower() == 'basic': -- return self.retry_http_basic_auth(host, req, realm) -+ unsupported = None -+ for header in headers: -+ for scheme, realm in self._parse_realm(header): -+ if scheme.lower() != 'basic': -+ unsupported = scheme -+ continue -+ -+ if realm is not None: -+ # Use the first matching Basic challenge. -+ # Ignore following challenges even if they use the Basic -+ # scheme. -+ return self.retry_http_basic_auth(host, req, realm) -+ -+ if unsupported is not None: -+ raise ValueError("AbstractBasicAuthHandler does not " -+ "support the following scheme: %r" -+ % (scheme,)) - - def retry_http_basic_auth(self, host, req, realm): - user, pw = self.passwd.find_user_password(realm, host) diff --git a/SOURCES/00347-ensurepip-invokes-pip-via-runpy.patch b/SOURCES/00347-ensurepip-invokes-pip-via-runpy.patch deleted file mode 100644 index 85c6a4b..0000000 --- a/SOURCES/00347-ensurepip-invokes-pip-via-runpy.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 36b63e76209e4cefaf5be790be6b8adaf2e3fc2b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Tue, 10 Mar 2020 22:16:28 +0100 -Subject: [PATCH] bpo-38662: ensurepip invokes pip via runpy (GH-18901) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The ensurepip module now invokes pip via the runpy module. -Hence it is no longer tightly coupled with the internal API of the bundled -pip version, allowing easier updates to a newer pip version both -internally and for distributors. - -This way, any changes to the internal pip API won't mean ensurepip needs to be -changed as well. Also, distributors can update their pip wheels independent on -CPython release schedule. - -Co-Authored-By: Pradyun Gedam -Co-Authored-By: Miro Hrončok ---- - Lib/ensurepip/__init__.py | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) - -diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py -index f5999ca..65b78c6 100644 ---- a/Lib/ensurepip/__init__.py -+++ b/Lib/ensurepip/__init__.py -@@ -3,6 +3,7 @@ import glob - import os - import os.path - import sys -+import runpy - import tempfile - - -@@ -34,9 +35,18 @@ def _run_pip(args, additional_paths=None): - if additional_paths is not None: - sys.path = additional_paths + sys.path - -- # Install the bundled software -- import pip._internal -- return pip._internal.main(args) -+ # Invoke pip as if it's the main module, and catch the exit. -+ backup_argv = sys.argv[:] -+ sys.argv[1:] = args -+ try: -+ # run_module() alters sys.modules and sys.argv, but restores them at exit -+ runpy.run_module("pip", run_name="__main__", alter_sys=True) -+ except SystemExit as exc: -+ return exc.code -+ finally: -+ sys.argv[:] = backup_argv -+ -+ raise SystemError("pip did not exit, this should never happen") - - - def version(): --- -2.25.3 - diff --git a/SOURCES/00350-sqlite-fix-deterministic-test.patch b/SOURCES/00350-sqlite-fix-deterministic-test.patch new file mode 100644 index 0000000..1ec23dd --- /dev/null +++ b/SOURCES/00350-sqlite-fix-deterministic-test.patch @@ -0,0 +1,76 @@ +commit 00a240bf7f95bbd220f1cfbf9eb58484a5f9681a +Author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> +Date: Fri May 29 05:46:34 2020 -0700 + + bpo-40784: Fix sqlite3 deterministic test (GH-20448) + + (cherry picked from commit c610d970f5373b143bf5f5900d4645e6a90fb460) + + Co-authored-by: Erlend Egeberg Aasland + +diff --git a/Lib/sqlite3/test/userfunctions.py b/Lib/sqlite3/test/userfunctions.py +index 9501f53..c11c82e 100644 +--- a/Lib/sqlite3/test/userfunctions.py ++++ b/Lib/sqlite3/test/userfunctions.py +@@ -1,8 +1,7 @@ +-#-*- coding: iso-8859-1 -*- + # pysqlite2/test/userfunctions.py: tests for user-defined functions and + # aggregates. + # +-# Copyright (C) 2005-2007 Gerhard H�ring ++# Copyright (C) 2005-2007 Gerhard Häring + # + # This file is part of pysqlite. + # +@@ -158,6 +157,7 @@ class FunctionTests(unittest.TestCase): + self.con.create_function("isblob", 1, func_isblob) + self.con.create_function("islonglong", 1, func_islonglong) + self.con.create_function("spam", -1, func) ++ self.con.execute("create table test(t text)") + + def tearDown(self): + self.con.close() +@@ -276,18 +276,36 @@ class FunctionTests(unittest.TestCase): + val = cur.fetchone()[0] + self.assertEqual(val, 2) + ++ # Regarding deterministic functions: ++ # ++ # Between 3.8.3 and 3.15.0, deterministic functions were only used to ++ # optimize inner loops, so for those versions we can only test if the ++ # sqlite machinery has factored out a call or not. From 3.15.0 and onward, ++ # deterministic functions were permitted in WHERE clauses of partial ++ # indices, which allows testing based on syntax, iso. the query optimizer. ++ @unittest.skipIf(sqlite.sqlite_version_info < (3, 8, 3), "Requires SQLite 3.8.3 or higher") + def CheckFuncNonDeterministic(self): + mock = unittest.mock.Mock(return_value=None) +- self.con.create_function("deterministic", 0, mock, deterministic=False) +- self.con.execute("select deterministic() = deterministic()") +- self.assertEqual(mock.call_count, 2) +- +- @unittest.skipIf(sqlite.sqlite_version_info < (3, 8, 3), "deterministic parameter not supported") ++ self.con.create_function("nondeterministic", 0, mock, deterministic=False) ++ if sqlite.sqlite_version_info < (3, 15, 0): ++ self.con.execute("select nondeterministic() = nondeterministic()") ++ self.assertEqual(mock.call_count, 2) ++ else: ++ with self.assertRaises(sqlite.OperationalError): ++ self.con.execute("create index t on test(t) where nondeterministic() is not null") ++ ++ @unittest.skipIf(sqlite.sqlite_version_info < (3, 8, 3), "Requires SQLite 3.8.3 or higher") + def CheckFuncDeterministic(self): + mock = unittest.mock.Mock(return_value=None) + self.con.create_function("deterministic", 0, mock, deterministic=True) +- self.con.execute("select deterministic() = deterministic()") +- self.assertEqual(mock.call_count, 1) ++ if sqlite.sqlite_version_info < (3, 15, 0): ++ self.con.execute("select deterministic() = deterministic()") ++ self.assertEqual(mock.call_count, 1) ++ else: ++ try: ++ self.con.execute("create index t on test(t) where deterministic() is not null") ++ except sqlite.OperationalError: ++ self.fail("Unexpected failure while creating partial index") + + @unittest.skipIf(sqlite.sqlite_version_info >= (3, 8, 3), "SQLite < 3.8.3 needed") + def CheckFuncDeterministicNotSupported(self): diff --git a/SOURCES/Python-3.8.0.tar.xz.asc b/SOURCES/Python-3.8.0.tar.xz.asc deleted file mode 100644 index 942a421..0000000 --- a/SOURCES/Python-3.8.0.tar.xz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCgAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl2kmqsACgkQsmmV4xAl -BWgUvRAAjomYhRM5CBKP99ygaTKAqeTHVnJt32O8n3OHPWL6YSSm2GBSnX4fhtqn -uX9VysXFc90zEX+ww2+n2+IwDzsddItWtdZfNnVAUeBs8GNGpq5KbnGX7LB7+orp -nJPcDUMsF2Mutuk7fREr8KHFUGSyMkUj+bh/1Ml+R7LGoTtPKywqtu7X0ACoJ3N0 -hds0qd79o8u5i2N5rLWfuj6/1HmorNwNhtJo7vIACZIUyIKP3rB8WXtE8+drptuv -ApYJdxE74iixntMuk6sCwPKBquIzwfEI3NzcmtJCV32cpASHB3+8FHJIlp94++9y -AUF4Kxp3aQui1XaeeLRdIpprl6M+PwB6tTQKoSkkecTVysj5GOdBRFEhGl5bFNO9 -DSiHU7uy8JkeOZVdcz4zIdZnlUUtCq4Ycpc8PXKjI0kbHlsp38y7F8lFNP10UY/D -iKDDGxQowCtVgKCORNhmKWCmEZcgbDZA9EAz9rgCdhPY7we3Qdj68L820ELxJeQj -50ss/6GcIJK1jgOSXng7DvUhlpsp5avhaM3iWnqCtU+a2fOVm0pQR826q62majLR -uui7SDKtVPU7VaLetfppuNjI3T8xUX86niSRtmlYjsjweJ+jXJWTnkkHUNI04UjH -2WANZRJ10NXl7UVRlnGYVzAcslyabnnlRw6Zf1haWtAWTLyP7Tw= -=bg98 ------END PGP SIGNATURE----- diff --git a/SOURCES/Python-3.8.3.tar.xz.asc b/SOURCES/Python-3.8.3.tar.xz.asc new file mode 100644 index 0000000..42c7be3 --- /dev/null +++ b/SOURCES/Python-3.8.3.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl68Z1QACgkQsmmV4xAl +BWhdxQ/+PUi0er9eBEaWNaatCsEDXnBvrCs1OooL3WWJ2GC5zf3buMwj2pFOZf9D +YFFGdomhYhvRnyQCJQSXuWJXQaafzKAl1tvkgS2ycOnLvCJ/qw71SqorQxkMGK1m +TYZyLEapNkXrfDXRHfGybuVlNsHw9++abpEITqwucTWm9LiHZoF/zdK+JX/5RYQ0 +bfb8819DMZEyCsF+S8Jo6ZNyEIQyQxidFFt5HbMllFwsgzu37P8RqGSIoVNFJ8n9 +f7BWfXAIyGr7pIlJ+3qBYDXOeOx8iwIUxGu3Gbmiri+dlxz28Iei4mxPYHG4ji5B +3zMsqKcaVAMHzKuAwdF5ZbUg0DRRJweNoiDOsfKp0CI814pXmOLH0zi9OiLrxBzj +7v9H3dAPMC2f2zAFdNcjYVBRovCxIork/Lj3+6jGn67+8oV+eb23gnN5YpDAFAAu +ybtrt6fEi0uVJuxUl+MO5HkSmH3sLggVDskvuWPFLiuahcbSuiZoCvlB+osO9J0H +el/3Awv5TjckY/EVDt1T61aYLX0CHNcb8c/CjAf0OSd/96WxV3svtusllqcSYwiC +NxBRf0klpGn0Tpa+9hTAMc4dEKILgao1KsKiI8dj8YY3HcE0Lb3y9UdFcIDLCeqn +Sk5turYyKak7apZTY31/0eqqCUl/RlZwpmxVUUNViwR5F2ZPeAQ= +=jF/G +-----END PGP SIGNATURE----- diff --git a/SPECS/python38.spec b/SPECS/python38.spec index d54fb33..521ecc1 100644 --- a/SPECS/python38.spec +++ b/SPECS/python38.spec @@ -13,11 +13,11 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.0 +%global general_version %{pybasever}.3 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 10%{?dist} +Release: 1%{?dist} License: Python # Exclude i686 arch. Due to a modularity issue it's being added to the @@ -62,6 +62,9 @@ ExcludeArch: i686 # Expensive optimizations (mainly, profile-guided optimizations) %bcond_without optimizations +# https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup +%bcond_without no_semantic_interposition + # Run the test suite in %%check %bcond_without tests @@ -141,16 +144,6 @@ ExcludeArch: i686 # on files that test invalid syntax. %undefine py_auto_byte_compile -# For multilib support, files that are different between 32- and 64-bit arches -# need different filenames. Use "64" or "32" according to the word size. -# Currently, the best way to determine an architecture's word size happens to -# be checking %%{_lib}. -%if "%{_lib}" == "lib64" -%global wordsize 64 -%else -%global wordsize 32 -%endif - # ======================= # Build-time requirements @@ -260,6 +253,8 @@ Patch111: 00111-no-static-lib.patch # 00189 # # Instead of bundled wheels, use our RPM packaged wheels from # /usr/share/python38-wheels +# Downstream only: upstream bundles +# We might eventually pursuit upstream support, but it's low prio Patch189: 00189-use-rpm-wheels.patch # 00251 @@ -267,6 +262,7 @@ Patch189: 00189-use-rpm-wheels.patch # to /usr/local if executable is /usr/bin/python* and RPM build # is not detected to make pip and distutils install into separate location # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe +# Downstream only: Awaiting resources to work on upstream PEP Patch251: 00251-change-user-install-location.patch # 00274 # @@ -276,6 +272,8 @@ Patch274: 00274-fix-arch-names.patch # 00328 # # Restore pyc to TIMESTAMP invalidation mode as default in rpmbubild # See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426 +# Downstream only: only used when building RPM packages +# Ideally, we should talk to upstream and explain why we don't want this Patch328: 00328-pyc-timestamp-invalidation-mode.patch # 00329 # @@ -301,32 +299,11 @@ Patch328: 00328-pyc-timestamp-invalidation-mode.patch # Resolves: rhbz#1731424 Patch329: 00329-fips.patch -# 00337 # -# Adjust the test_min_max_version in test_ssl to accept the new settings in -# RHEL 8.2 where maximum_version is set to TLS 1.3 -Patch337: 00337-test_ssl-test_min_max_version-add-range.patch - -# 00345 # -# Skip from test_site the test_startup_imports case if a path of sys.path -# contains a .pth file -# Fixed upstream: https://bugs.python.org/issue27807 -# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1815643 -Patch345: 00345-fix-test_site-with-extra-pth-files.patch - -# 00346 # -# Fix CVE-2020-8492: wrong backtracking in urllib.request.AbstractBasicAuthHandler allows for a ReDoS -# Fixed upstream: https://bugs.python.org/issue39503 -# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1810622 -Patch346: 00346-CVE-2020-8492.patch - -# 00347 # -# The ensurepip module now invokes pip via the runpy module. -# Hence it is no longer tightly coupled with the internal API of the bundled -# pip version, allowing easier updates to a newer pip version both -# internally and for distributors. -# Backported from upstream during an update of pip from 19.2.3 to 19.3.1 -# https://github.com/python/cpython/commit/88f82b2b9ea3514359cb6e3218121f75334063ac -Patch347: 00347-ensurepip-invokes-pip-via-runpy.patch +# 00350 # +# bpo-40784: Fix sqlite3 deterministic test (GH-20448) +# https://bugs.python.org/issue40784 +# https://github.com/python/cpython/commit/00a240bf7f95bbd220f1cfbf9eb58484a5f9681a +Patch350: 00350-sqlite-fix-deterministic-test.patch # (New patches go here ^^^) # @@ -463,6 +440,10 @@ Provides: bundled(python38-setuptools) = 41.2.0 # See https://bugzilla.redhat.com/show_bug.cgi?id=1547131 Recommends: %{name}%{?_isa} = %{version}-%{release} +# tkinter is part of the standard library, +# but it is torn out to save an unwanted dependency on tk and X11. +# we recommend it when tk is already installed (for better UX) +Recommends: (%{name}-tkinter%{?_isa} = %{version}-%{release} if tk%{?_isa}) %description libs This package contains runtime libraries for use by Python: @@ -671,10 +652,7 @@ rm Lib/ensurepip/_bundled/*.whl %patch274 -p1 %patch328 -p1 %patch329 -p1 -%patch337 -p1 -%patch345 -p1 -%patch346 -p1 -%patch347 -p1 +%patch350 -p1 # Remove files that should be generated by the build @@ -717,14 +695,14 @@ topdir=$(pwd) # Fedora packages utilizing %%py3_build will use them as well # https://fedoraproject.org/wiki/Changes/Python_Extension_Flags export CFLAGS="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv" -export CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition" +export CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv%{?with_no_semantic_interposition: -fno-semantic-interposition}" export CXXFLAGS="%{extension_cxxflags} -D_GNU_SOURCE -fPIC -fwrapv" export CPPFLAGS="$(pkg-config --cflags-only-I libffi)" export OPT="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv" export LINKCC="gcc" export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)" export LDFLAGS="%{extension_ldflags} -g $(pkg-config --libs-only-L openssl)" -export LDFLAGS_NODIST="%{build_ldflags} -fno-semantic-interposition -g $(pkg-config --libs-only-L openssl)" +export LDFLAGS_NODIST="%{build_ldflags}%{?with_no_semantic_interposition: -fno-semantic-interposition} -g $(pkg-config --libs-only-L openssl)" # We can build several different configurations of Python: regular and debug. # Define a common function that does one build: @@ -829,7 +807,7 @@ mkdir -p %{buildroot}$DirHoldingGdbPy # Filanames are defined here: %global _pyconfig32_h pyconfig-32.h %global _pyconfig64_h pyconfig-64.h -%global _pyconfig_h pyconfig-%{wordsize}.h +%global _pyconfig_h pyconfig-%{__isa_bits}.h # Use a common function to do an install for all our configurations: InstallPython() { @@ -1107,6 +1085,7 @@ CheckPython() { LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.pythoninfo # Run the upstream test suite + # --timeout=1800: kill test running for longer than 30 minutes # test_gdb skipped on s390x: # https://bugzilla.redhat.com/show_bug.cgi?id=1678277 # test_gdb skipped everywhere: @@ -1115,7 +1094,7 @@ CheckPython() { # distutils.tests.test_bdist_rpm tests fail when bootstraping the Python # package: rpmbuild requires /usr/bin/pythonX.Y to be installed LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ - -wW --slowest -j0 \ + -wW --slowest -j0 --timeout=1800 \ %if %{with bootstrap} -x test_distutils \ %endif @@ -1715,7 +1694,7 @@ fi %ghost %{_bindir}/python3-debug-config %{_libdir}/libpython%{LDVERSION_debug}.so -%{_libdir}/libpython%{LDVERSION_debug}.so.1.0 +%{_libdir}/libpython%{LDVERSION_debug}.so.%{py_SOVERSION} %{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc %{_libdir}/pkgconfig/python-%{LDVERSION_debug}-embed.pc @@ -1757,6 +1736,18 @@ fi # ====================================================== %changelog +* Wed Jun 24 2020 Tomas Orsava - 3.8.3-2 +- Fix sqlite3 deterministic test +Related: rhbz#1847416 + +* Wed Jun 24 2020 Tomas Orsava - 3.8.3-1 +- Rebased to 3.8.3 final +- Backported changes from Fedora + - Recommend python3-tkinter when tk is installed + - Add bcond for no_semantic_interposition (enabled by default) + - Update the ensurepip module to work with setuptools >= 45 +Resolves: rhbz#1847416 + * Thu May 07 2020 Charalampos Stratakis - 3.8.0-10 - Fix test_hashlib and test_hmac under FIPS mode Resolves: rhbz#1812477