From ea8864e085857219bc87e35311204eb464c1accd Mon Sep 17 00:00:00 2001 From: Ivan Konov Date: Wed, 20 Dec 2023 16:44:38 +0300 Subject: [PATCH 1/4] spec: fixes for redos build --- python-boto.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-boto.spec b/python-boto.spec index 784d90ecc0..855dbd881e 100644 --- a/python-boto.spec +++ b/python-boto.spec @@ -1,6 +1,6 @@ %{!?__python3: %global __python3 /usr/bin/python3} %{!?python3_sitelib: %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%if 0%{?el8} +%if 0%{?rhel} == 8 || 0%{?redos} == 7 %global el_python3_pkgversion 3 %else %global el_python3_pkgversion 36 From 144306e371a57b467e910b71160d3f59d97253ba Mon Sep 17 00:00:00 2001 From: Ivan Konov Date: Wed, 20 Dec 2023 18:36:49 +0300 Subject: [PATCH 2/4] tests: replace deprecated cgi.escape() with html.escape() --- boto/ecs/item.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boto/ecs/item.py b/boto/ecs/item.py index 79177a31d4..7f19b918e7 100644 --- a/boto/ecs/item.py +++ b/boto/ecs/item.py @@ -21,7 +21,7 @@ import xml.sax -import cgi +import html from boto.compat import six, StringIO class ResponseGroup(xml.sax.ContentHandler): @@ -67,7 +67,7 @@ def startElement(self, name, attrs, connection): return None def endElement(self, name, value, connection): - self._xml.write("%s" % (cgi.escape(value).replace("&", "&"), name)) + self._xml.write("%s" % (html.escape(value, quote=False).replace("&", "&"), name)) if len(self._nodepath) == 0: return obj = None From ad6c5024038c2a8192330ac35ac775c273baf502 Mon Sep 17 00:00:00 2001 From: Ivan Konov Date: Wed, 20 Dec 2023 19:00:25 +0300 Subject: [PATCH 3/4] tests: add parameter required since py3.8 to hmac.new() calls --- tests/db/test_password.py | 7 +++++-- tests/unit/utils/test_utils.py | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/db/test_password.py b/tests/db/test_password.py index 74c3409526..44ad7ded54 100644 --- a/tests/db/test_password.py +++ b/tests/db/test_password.py @@ -24,6 +24,9 @@ import logging import time +from hashlib import md5 + + log= logging.getLogger('password_property_test') log.setLevel(logging.DEBUG) @@ -37,7 +40,7 @@ def tearDown(self): def hmac_hashfunc(self): import hmac def hashfunc(msg): - return hmac.new('mysecret', msg) + return hmac.new('mysecret', msg, digestmod=md5) return hashfunc def test_model(self,hashfunc=None): @@ -98,7 +101,7 @@ def test_aaa_default_password_property(self): def test_password_constructor_hashfunc(self): import hmac - myhashfunc=lambda msg: hmac.new('mysecret', msg) + myhashfunc=lambda msg: hmac.new('mysecret', msg, digestmod=md5) cls = self.test_model(hashfunc=myhashfunc) obj = cls() obj.password='hello' diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index db15b56d58..d2e8dfb37b 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -85,7 +85,7 @@ def test_hmac(self): def hmac_hashfunc(cls, msg): if not isinstance(msg, bytes): msg = msg.encode('utf-8') - return hmac.new(b'mysecretkey', msg) + return hmac.new(b'mysecretkey', msg, digestmod=hashlib.md5) class HMACPassword(Password): hashfunc = hmac_hashfunc @@ -95,15 +95,15 @@ class HMACPassword(Password): password.set('foo') self.assertEquals(str(password), - hmac.new(b'mysecretkey', b'foo').hexdigest()) + hmac.new(b'mysecretkey', b'foo', digestmod=hashlib.md5).hexdigest()) def test_constructor(self): - hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg) + hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg, digestmod=hashlib.md5) password = Password(hashfunc=hmac_hashfunc) password.set('foo') self.assertEquals(password.str, - hmac.new(b'mysecretkey', b'foo').hexdigest()) + hmac.new(b'mysecretkey', b'foo', digestmod=hashlib.md5).hexdigest()) class TestPythonizeName(unittest.TestCase): From 4f24ae392cf42f8986a378aff76c5238cef160e1 Mon Sep 17 00:00:00 2001 From: Ivan Konov Date: Thu, 21 Dec 2023 11:41:28 +0300 Subject: [PATCH 4/4] spec: update changelog, bump version --- python-boto.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python-boto.spec b/python-boto.spec index 855dbd881e..b15ed26b75 100644 --- a/python-boto.spec +++ b/python-boto.spec @@ -21,7 +21,7 @@ cloud systems like Eucalyptus, OpenStack and Open Nebula. Summary: A simple, lightweight interface to Amazon Web Services Name: python-%{pkgname} Version: 2.46.1 -Release: CROC48%{?buildid}%{?dist} +Release: CROC49%{?buildid}%{?dist} License: MIT Group: Development/Languages URL: https://github.com/c2devel/boto @@ -67,6 +67,11 @@ rm -f %buildroot/%{_bindir}/* %changelog +* Thu Dec 21 2023 Ivan Konov - 2.46.1-CROC49 +- tests: add parameter required since py3.8 to hmac.new() calls +- tests: replace deprecated cgi.escape() with html.escape() +- spec: fixes for redos build + * Thu Oct 12 2023 Grigoriy Kulagin - 2.46.1-CROC48 - .github: remove old py version checks - ec2: add os and new instance type format