From 8795b7f779b0cb4c0f12b0872d64fa7e25eca4ff Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 26 Apr 2022 09:52:28 -0400 Subject: [PATCH] import python-suds-0.7-0.8.94664ddd46a6.el8_5.2 --- SOURCES/bz2059753-fix-fips-issue.patch | 47 ++++++++++++++++++++++++++ SPECS/python-suds.spec | 8 ++++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 SOURCES/bz2059753-fix-fips-issue.patch diff --git a/SOURCES/bz2059753-fix-fips-issue.patch b/SOURCES/bz2059753-fix-fips-issue.patch new file mode 100644 index 0000000..90cdbad --- /dev/null +++ b/SOURCES/bz2059753-fix-fips-issue.patch @@ -0,0 +1,47 @@ +From 75e4a9eb929520d95cb55b2d850af7ba849fd014 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Mon, 28 Feb 2022 11:23:55 +0100 +Subject: [PATCH] Use usedforsecurity=False for md5() calls to make suds work + on FIPS enabled systems + +--- + suds/reader.py | 7 ++++++- + suds/wsse.py | 7 ++++++- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/suds/reader.py b/suds/reader.py +index 31c5ee7..3354b5d 100644 +--- a/suds/reader.py ++++ b/suds/reader.py +@@ -58,7 +58,12 @@ def mangle(self, name, x): + @rtype: str + + """ +- h = md5(name.encode()).hexdigest() ++ try: ++ # FIPS requires usedforsecurity=False and might not be ++ # available on all distros: https://bugs.python.org/issue9216 ++ h = md5(name.encode(), usedforsecurity=False).hexdigest() ++ except AttributeError: ++ h = md5(name.encode()).hexdigest() + return '%s-%s' % (h, x) + + +diff --git a/suds/wsse.py b/suds/wsse.py +index 96d9eb6..474d15a 100644 +--- a/suds/wsse.py ++++ b/suds/wsse.py +@@ -158,7 +158,12 @@ def setnonce(self, text=None): + s.append(self.username) + s.append(self.password) + s.append(Token.sysdate()) +- m = md5() ++ try: ++ # FIPS requires usedforsecurity=False and might not be ++ # available on all distros: https://bugs.python.org/issue9216 ++ m = md5(usedforsecurity=False) ++ except AttributeError: ++ m = md5() + m.update(':'.join(s)) + self.nonce = m.hexdigest() + else: diff --git a/SPECS/python-suds.spec b/SPECS/python-suds.spec index c3ce835..097a585 100644 --- a/SPECS/python-suds.spec +++ b/SPECS/python-suds.spec @@ -28,9 +28,10 @@ services and WSDL based objects can be easily inspected. Summary: %{sum} Name: python-suds Version: 0.7 -Release: 0.8.%{shortcommit}%{?dist} +Release: 0.8.%{shortcommit}%{?dist}.2 Source0: https://bitbucket.org/jurko/suds/get/%{shortcommit}.tar.bz2 Patch0: fix_http_test.patch +Patch1: bz2059753-fix-fips-issue.patch License: LGPLv3+ Group: Development/Libraries BuildArch: noarch @@ -59,6 +60,7 @@ Summary: %{sum} mv jurko-suds-%{shortcommit} %{py2_builddir} pushd %{py2_builddir} %patch0 -p1 +%patch1 -p1 popd %if 0%{?with_python3} cp -a %{py2_builddir} %{py3_builddir} @@ -115,6 +117,10 @@ popd %endif %changelog +* Tue Mar 8 2022 Oyvind Albrigtsen - 0.7-0.8.94664ddd46a6.2 +- Fix FIPS issue + Resolves: rhbz#2059753 + * Mon Jul 09 2018 Petr Viktorin - 0.7-0.8.94664ddd46a6 - Don't build the python2 subpackage in rhel>7 https://bugzilla.redhat.com/show_bug.cgi?id=1567165