From 134d38774c35a9001040ea9f6d4fc11b83691cbc540bfbe2de24af480976d81b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 13 Dec 2024 12:00:21 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main python-pyasn1-modules revision 33fdc7213da54f561fa478cef2f2c63e --- pyasn1-061.patch | 168 ++++++++++++++++++++++++++++++++++ pyasn1_modules-0.3.0.tar.gz | 3 - pyasn1_modules-0.4.1.tar.gz | 3 + python-pyasn1-modules.changes | 14 +++ python-pyasn1-modules.spec | 10 +- 5 files changed, 191 insertions(+), 7 deletions(-) create mode 100644 pyasn1-061.patch delete mode 100644 pyasn1_modules-0.3.0.tar.gz create mode 100644 pyasn1_modules-0.4.1.tar.gz diff --git a/pyasn1-061.patch b/pyasn1-061.patch new file mode 100644 index 0000000..99de11d --- /dev/null +++ b/pyasn1-061.patch @@ -0,0 +1,168 @@ +From 079c176eb00ed7352c9696efa12a0577beeecd71 Mon Sep 17 00:00:00 2001 +From: Heiko Becker +Date: Wed, 25 Sep 2024 22:38:42 +0200 +Subject: [PATCH] Stop using pyasn1.compat.octets + +It was removed from pyasn1 in +https://github.com/pyasn1/pyasn1/commit/6f770ba886a8931c35cb090a5c3a6d67f5a41bd9 + +Fixes #19. +--- + tests/test_pem.py | 3 +-- + tests/test_rfc3770.py | 3 +-- + tests/test_rfc4073.py | 3 +-- + tests/test_rfc4334.py | 3 +-- + tests/test_rfc5755.py | 3 +-- + tests/test_rfc6032.py | 7 +++---- + tests/test_rfc6120.py | 1 - + 7 files changed, 8 insertions(+), 15 deletions(-) + +diff --git a/tests/test_pem.py b/tests/test_pem.py +index dbcca5a7..e0fe334d 100644 +--- a/tests/test_pem.py ++++ b/tests/test_pem.py +@@ -7,7 +7,6 @@ + import sys + import unittest + +-from pyasn1.compat.octets import ints2octs + from pyasn1_modules import pem + + +@@ -93,7 +92,7 @@ def testReadBase64fromText(self): + 24, 102, 241, 236, 50 + ] + +- self.assertEqual(ints2octs(expected), binary) ++ self.assertEqual(bytes(expected), binary) + + + suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__]) +diff --git a/tests/test_rfc3770.py b/tests/test_rfc3770.py +index 667ab249..93d40932 100644 +--- a/tests/test_rfc3770.py ++++ b/tests/test_rfc3770.py +@@ -10,7 +10,6 @@ + + from pyasn1.codec.der.decoder import decode as der_decoder + from pyasn1.codec.der.encoder import encode as der_encoder +-from pyasn1.compat.octets import str2octs + + from pyasn1_modules import pem + from pyasn1_modules import rfc5480 +@@ -79,7 +78,7 @@ def testOpenTypes(self): + self.assertEqual(extn['extnValue'], der_encoder(extnValue)) + + if extn['extnID'] == rfc3770.id_pe_wlanSSID: +- self.assertIn(str2octs('Example'), extnValue) ++ self.assertIn(b'Example', extnValue) + + if extn['extnID'] == rfc5280.id_ce_extKeyUsage: + self.assertIn(rfc3770.id_kp_eapOverLAN, extnValue) +diff --git a/tests/test_rfc4073.py b/tests/test_rfc4073.py +index 4bd5e5f7..3b516ccb 100644 +--- a/tests/test_rfc4073.py ++++ b/tests/test_rfc4073.py +@@ -10,7 +10,6 @@ + + from pyasn1.codec.der.decoder import decode as der_decoder + from pyasn1.codec.der.encoder import encode as der_encoder +-from pyasn1.compat.octets import str2octs + + from pyasn1_modules import pem + from pyasn1_modules import rfc2634 +@@ -131,7 +130,7 @@ def testOpenTypes(self): + + self.assertIn(next_ci['contentType'], rfc5652.cmsContentTypesMap) + self.assertEqual(rfc5652.id_data, next_ci['contentType']) +- self.assertIn(str2octs('Content-Type: text'), next_ci['content']) ++ self.assertIn(b'Content-Type: text', next_ci['content']) + + for attr in ci['content']['attrs']: + self.assertIn(attr['attrType'], rfc5652.cmsAttributesMap) +diff --git a/tests/test_rfc4334.py b/tests/test_rfc4334.py +index 9ba5fdf3..e180d676 100644 +--- a/tests/test_rfc4334.py ++++ b/tests/test_rfc4334.py +@@ -10,7 +10,6 @@ + + from pyasn1.codec.der.decoder import decode as der_decoder + from pyasn1.codec.der.encoder import encode as der_encoder +-from pyasn1.compat.octets import str2octs + + from pyasn1_modules import pem + from pyasn1_modules import rfc5280 +@@ -67,7 +66,7 @@ def testOpenTypes(self): + self.assertEqual(extn['extnValue'], der_encoder(extnValue)) + + if extn['extnID'] == rfc4334.id_pe_wlanSSID: +- self.assertIn( str2octs('Example'), extnValue) ++ self.assertIn(b'Example', extnValue) + + if extn['extnID'] == rfc5280.id_ce_extKeyUsage: + self.assertIn(rfc4334.id_kp_eapOverLAN, extnValue) +diff --git a/tests/test_rfc5755.py b/tests/test_rfc5755.py +index cf4a05fa..46908e23 100644 +--- a/tests/test_rfc5755.py ++++ b/tests/test_rfc5755.py +@@ -10,7 +10,6 @@ + + from pyasn1.codec.der.decoder import decode as der_decoder + from pyasn1.codec.der.encoder import encode as der_encoder +-from pyasn1.compat.octets import str2octs + + from pyasn1_modules import pem + from pyasn1_modules import rfc5280 +@@ -85,7 +84,7 @@ def testOpenTypes(self): + count += 1 + if attr['type'] == rfc5755.id_aca_authenticationInfo: + self.assertEqual( +- str2octs('password'), attr['values'][0]['authInfo']) ++ b'password', attr['values'][0]['authInfo']) + + self.assertEqual(5, count) + +diff --git a/tests/test_rfc6032.py b/tests/test_rfc6032.py +index 287bad89..2327416d 100644 +--- a/tests/test_rfc6032.py ++++ b/tests/test_rfc6032.py +@@ -10,7 +10,6 @@ + + from pyasn1.codec.der.decoder import decode as der_decoder + from pyasn1.codec.der.encoder import encode as der_encoder +-from pyasn1.compat.octets import str2octs + + from pyasn1_modules import pem + from pyasn1_modules import rfc5652 +@@ -64,7 +63,7 @@ def testDerCodec(self): + self.assertFalse(rest) + self.assertTrue(keyid.prettyPrint()) + self.assertEqual(attrVal0, der_encoder(keyid)) +- self.assertEqual(str2octs('ptf-kdc-812374'), keyid) ++ self.assertEqual(b'ptf-kdc-812374', keyid) + + def testOpenTypes(self): + substrate = pem.readBase64fromText(self.encrypted_key_pkg_pem_text) +@@ -86,8 +85,8 @@ def testOpenTypes(self): + self.assertNotEqual('0x', attr['attrValues'][0].prettyPrint()[:2]) + + if attr['attrType'] == rfc6032.id_aa_KP_contentDecryptKeyID: +- self.assertEqual(str2octs( +- 'ptf-kdc-812374'), attr['attrValues'][0]) ++ self.assertEqual( ++ b'ptf-kdc-812374', attr['attrValues'][0]) + + + suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__]) +diff --git a/tests/test_rfc6120.py b/tests/test_rfc6120.py +index bdedab8c..a6217454 100644 +--- a/tests/test_rfc6120.py ++++ b/tests/test_rfc6120.py +@@ -10,7 +10,6 @@ + + from pyasn1.codec.der.decoder import decode as der_decoder + from pyasn1.codec.der.encoder import encode as der_encoder +-from pyasn1.compat.octets import str2octs + + from pyasn1_modules import pem + from pyasn1_modules import rfc5280 diff --git a/pyasn1_modules-0.3.0.tar.gz b/pyasn1_modules-0.3.0.tar.gz deleted file mode 100644 index e4e2c86..0000000 --- a/pyasn1_modules-0.3.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5bd01446b736eb9d31512a30d46c1ac3395d676c6f3cafa4c03eb54b9925631c -size 307901 diff --git a/pyasn1_modules-0.4.1.tar.gz b/pyasn1_modules-0.4.1.tar.gz new file mode 100644 index 0000000..1f7818c --- /dev/null +++ b/pyasn1_modules-0.4.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c28e2dbf9c06ad61c71a075c7e0f9fd0f1b0bb2d2ad4377f240d33ac2ab60a7c +size 310028 diff --git a/python-pyasn1-modules.changes b/python-pyasn1-modules.changes index 3d6a454..63197e9 100644 --- a/python-pyasn1-modules.changes +++ b/python-pyasn1-modules.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Mon Oct 7 15:29:49 UTC 2024 - Markéta Machová + +- Update to 0.4.1 + * Added support for Python 3.13 +- Add upstream pyasn1-061.patch to fix tests with recent pyasn1 + +------------------------------------------------------------------- +Thu Mar 28 12:16:19 UTC 2024 - Dirk Müller + +- update to 0.4.0: + * Added support for Python 3.11, 3.12 + * Removed support for EOL Pythons 2.7, 3.6, 3.7 + ------------------------------------------------------------------- Thu May 4 19:28:21 UTC 2023 - Dirk Müller diff --git a/python-pyasn1-modules.spec b/python-pyasn1-modules.spec index a4e7d59..4057eec 100644 --- a/python-pyasn1-modules.spec +++ b/python-pyasn1-modules.spec @@ -1,7 +1,7 @@ # # spec file for package python-pyasn1-modules # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,16 +16,18 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?sle15_python_module_pythons} Name: python-pyasn1-modules -Version: 0.3.0 +Version: 0.4.1 Release: 0 Summary: Collection of protocols modules written in ASN.1 language License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/pyasn1/pyasn1-modules Source: https://files.pythonhosted.org/packages/source/p/pyasn1-modules/pyasn1_modules-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/pyasn1/pyasn1-modules/pull/22 Stop using pyasn1.compat.octets +Patch0: pyasn1-061.patch +BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module pip} BuildRequires: %{python_module pyasn1 >= 0.4.7} BuildRequires: %{python_module pytest} @@ -43,7 +45,7 @@ then generalized to be suitable for a wide range of protocols based on ASN.1 specification. %prep -%setup -q -n pyasn1_modules-%{version} +%autosetup -p1 -n pyasn1_modules-%{version} %build %pyproject_wheel