diff --git a/Fix-pip-install-in-FIPS-mode.patch b/Fix-pip-install-in-FIPS-mode.patch new file mode 100644 index 0000000..0054e4f --- /dev/null +++ b/Fix-pip-install-in-FIPS-mode.patch @@ -0,0 +1,29 @@ +From 1dc2aa897ddda51503572f3f70a4818cf9a3884d Mon Sep 17 00:00:00 2001 +From: Tomas Orsava +Date: Fri, 17 Mar 2017 13:14:56 +0100 +Subject: [PATCH] Fix `pip install` in FIPS mode + +Resolves: rhbz#1430774 +--- + pip/utils/hashes.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/pip/utils/hashes.py b/pip/utils/hashes.py +index 9602970..c6d7524 100644 +--- a/pip/utils/hashes.py ++++ b/pip/utils/hashes.py +@@ -39,7 +39,10 @@ class Hashes(object): + gots = {} + for hash_name in iterkeys(self._allowed): + try: +- gots[hash_name] = hashlib.new(hash_name) ++ if hash_name == 'md5': ++ gots[hash_name] = hashlib.new(hash_name, usedforsecurity=False) ++ else: ++ gots[hash_name] = hashlib.new(hash_name) + except (ValueError, TypeError): + raise InstallationError('Unknown hash name: %s' % hash_name) + +-- +2.11.0 + diff --git a/python-pip.spec b/python-pip.spec index 5464dc5..a3e36bd 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -17,7 +17,7 @@ Name: python-%{srcname} Version: 8.1.2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A tool for installing and managing Python packages Group: Development/Libraries @@ -39,6 +39,10 @@ Source1: pip-8.1.2-tests.tar.gz # https://github.com/pypa/pip/issues/1351 Patch0: allow-stripping-given-prefix-from-wheel-RECORD-files.patch +# Fix `pip install` failure in FIPS mode +# Resolves: rhbz#1430774 +Patch1: Fix-pip-install-in-FIPS-mode.patch + %description Pip is a replacement for `easy_install `_. It uses mostly the @@ -115,6 +119,7 @@ tar -xf %{SOURCE1} %endif %patch0 -p1 +%patch1 -p1 sed -i '1d' pip/__init__.py @@ -226,6 +231,10 @@ py.test-%{python3_version} -m 'not network' %endif # with_python3 %changelog +* Wed Apr 04 2018 Tomas Orsava - 8.1.2-6 +- Added Patch 1: Fix `pip install` failure in FIPS mode +Resolves: rhbz#1430774 + * Fri Nov 18 2016 Orion Poplawski - 8.1.2-5 - Enable EPEL Python 3 builds - Use new python macros