diff options
-rw-r--r-- | meta-python/recipes-devtools/python/python3-pyasn1-modules/0001-Stop-using-pyasn1.compat.octets.patch | 171 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-pyasn1-modules_0.4.1.bb | 1 |
2 files changed, 172 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pyasn1-modules/0001-Stop-using-pyasn1.compat.octets.patch b/meta-python/recipes-devtools/python/python3-pyasn1-modules/0001-Stop-using-pyasn1.compat.octets.patch new file mode 100644 index 000000000..d9751b718 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pyasn1-modules/0001-Stop-using-pyasn1.compat.octets.patch | |||
@@ -0,0 +1,171 @@ | |||
1 | From d20c89d017a572755484b1bc41eac20285e68550 Mon Sep 17 00:00:00 2001 | ||
2 | From: Heiko Becker <mail@heiko-becker.de> | ||
3 | Date: Wed, 25 Sep 2024 22:38:42 +0200 | ||
4 | Subject: [PATCH] Stop using pyasn1.compat.octets | ||
5 | |||
6 | It was removed from pyasn1 in | ||
7 | https://github.com/pyasn1/pyasn1/commit/6f770ba886a8931c35cb090a5c3a6d67f5a41bd9 | ||
8 | |||
9 | Fixes #19. | ||
10 | |||
11 | Upstream-Status: Submitted [https://github.com/pyasn1/pyasn1-modules/pull/22] | ||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | tests/test_pem.py | 3 +-- | ||
15 | tests/test_rfc3770.py | 3 +-- | ||
16 | tests/test_rfc4073.py | 3 +-- | ||
17 | tests/test_rfc4334.py | 3 +-- | ||
18 | tests/test_rfc5755.py | 3 +-- | ||
19 | tests/test_rfc6032.py | 7 +++---- | ||
20 | tests/test_rfc6120.py | 1 - | ||
21 | 7 files changed, 8 insertions(+), 15 deletions(-) | ||
22 | |||
23 | diff --git a/tests/test_pem.py b/tests/test_pem.py | ||
24 | index dbcca5a..e0fe334 100644 | ||
25 | --- a/tests/test_pem.py | ||
26 | +++ b/tests/test_pem.py | ||
27 | @@ -7,7 +7,6 @@ | ||
28 | import sys | ||
29 | import unittest | ||
30 | |||
31 | -from pyasn1.compat.octets import ints2octs | ||
32 | from pyasn1_modules import pem | ||
33 | |||
34 | |||
35 | @@ -93,7 +92,7 @@ GGbx7DI= | ||
36 | 24, 102, 241, 236, 50 | ||
37 | ] | ||
38 | |||
39 | - self.assertEqual(ints2octs(expected), binary) | ||
40 | + self.assertEqual(bytes(expected), binary) | ||
41 | |||
42 | |||
43 | suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__]) | ||
44 | diff --git a/tests/test_rfc3770.py b/tests/test_rfc3770.py | ||
45 | index 667ab24..93d4093 100644 | ||
46 | --- a/tests/test_rfc3770.py | ||
47 | +++ b/tests/test_rfc3770.py | ||
48 | @@ -10,7 +10,6 @@ import unittest | ||
49 | |||
50 | from pyasn1.codec.der.decoder import decode as der_decoder | ||
51 | from pyasn1.codec.der.encoder import encode as der_encoder | ||
52 | -from pyasn1.compat.octets import str2octs | ||
53 | |||
54 | from pyasn1_modules import pem | ||
55 | from pyasn1_modules import rfc5480 | ||
56 | @@ -79,7 +78,7 @@ DAlVlhox680Jxy5J8Pkx | ||
57 | self.assertEqual(extn['extnValue'], der_encoder(extnValue)) | ||
58 | |||
59 | if extn['extnID'] == rfc3770.id_pe_wlanSSID: | ||
60 | - self.assertIn(str2octs('Example'), extnValue) | ||
61 | + self.assertIn(b'Example', extnValue) | ||
62 | |||
63 | if extn['extnID'] == rfc5280.id_ce_extKeyUsage: | ||
64 | self.assertIn(rfc3770.id_kp_eapOverLAN, extnValue) | ||
65 | diff --git a/tests/test_rfc4073.py b/tests/test_rfc4073.py | ||
66 | index 4bd5e5f..3b516cc 100644 | ||
67 | --- a/tests/test_rfc4073.py | ||
68 | +++ b/tests/test_rfc4073.py | ||
69 | @@ -10,7 +10,6 @@ import unittest | ||
70 | |||
71 | from pyasn1.codec.der.decoder import decode as der_decoder | ||
72 | from pyasn1.codec.der.encoder import encode as der_encoder | ||
73 | -from pyasn1.compat.octets import str2octs | ||
74 | |||
75 | from pyasn1_modules import pem | ||
76 | from pyasn1_modules import rfc2634 | ||
77 | @@ -131,7 +130,7 @@ buWO3egPDL8Kf7tBhzjIKLw= | ||
78 | |||
79 | self.assertIn(next_ci['contentType'], rfc5652.cmsContentTypesMap) | ||
80 | self.assertEqual(rfc5652.id_data, next_ci['contentType']) | ||
81 | - self.assertIn(str2octs('Content-Type: text'), next_ci['content']) | ||
82 | + self.assertIn(b'Content-Type: text', next_ci['content']) | ||
83 | |||
84 | for attr in ci['content']['attrs']: | ||
85 | self.assertIn(attr['attrType'], rfc5652.cmsAttributesMap) | ||
86 | diff --git a/tests/test_rfc4334.py b/tests/test_rfc4334.py | ||
87 | index 9ba5fdf..e180d67 100644 | ||
88 | --- a/tests/test_rfc4334.py | ||
89 | +++ b/tests/test_rfc4334.py | ||
90 | @@ -10,7 +10,6 @@ import unittest | ||
91 | |||
92 | from pyasn1.codec.der.decoder import decode as der_decoder | ||
93 | from pyasn1.codec.der.encoder import encode as der_encoder | ||
94 | -from pyasn1.compat.octets import str2octs | ||
95 | |||
96 | from pyasn1_modules import pem | ||
97 | from pyasn1_modules import rfc5280 | ||
98 | @@ -67,7 +66,7 @@ DAlVlhox680Jxy5J8Pkx | ||
99 | self.assertEqual(extn['extnValue'], der_encoder(extnValue)) | ||
100 | |||
101 | if extn['extnID'] == rfc4334.id_pe_wlanSSID: | ||
102 | - self.assertIn( str2octs('Example'), extnValue) | ||
103 | + self.assertIn(b'Example', extnValue) | ||
104 | |||
105 | if extn['extnID'] == rfc5280.id_ce_extKeyUsage: | ||
106 | self.assertIn(rfc4334.id_kp_eapOverLAN, extnValue) | ||
107 | diff --git a/tests/test_rfc5755.py b/tests/test_rfc5755.py | ||
108 | index cf4a05f..46908e2 100644 | ||
109 | --- a/tests/test_rfc5755.py | ||
110 | +++ b/tests/test_rfc5755.py | ||
111 | @@ -10,7 +10,6 @@ import unittest | ||
112 | |||
113 | from pyasn1.codec.der.decoder import decode as der_decoder | ||
114 | from pyasn1.codec.der.encoder import encode as der_encoder | ||
115 | -from pyasn1.compat.octets import str2octs | ||
116 | |||
117 | from pyasn1_modules import pem | ||
118 | from pyasn1_modules import rfc5280 | ||
119 | @@ -85,7 +84,7 @@ Q4eikPk4LQey | ||
120 | count += 1 | ||
121 | if attr['type'] == rfc5755.id_aca_authenticationInfo: | ||
122 | self.assertEqual( | ||
123 | - str2octs('password'), attr['values'][0]['authInfo']) | ||
124 | + b'password', attr['values'][0]['authInfo']) | ||
125 | |||
126 | self.assertEqual(5, count) | ||
127 | |||
128 | diff --git a/tests/test_rfc6032.py b/tests/test_rfc6032.py | ||
129 | index 287bad8..2327416 100644 | ||
130 | --- a/tests/test_rfc6032.py | ||
131 | +++ b/tests/test_rfc6032.py | ||
132 | @@ -10,7 +10,6 @@ import unittest | ||
133 | |||
134 | from pyasn1.codec.der.decoder import decode as der_decoder | ||
135 | from pyasn1.codec.der.encoder import encode as der_encoder | ||
136 | -from pyasn1.compat.octets import str2octs | ||
137 | |||
138 | from pyasn1_modules import pem | ||
139 | from pyasn1_modules import rfc5652 | ||
140 | @@ -64,7 +63,7 @@ YIZIAWUCAQVCMRAEDnB0Zi1rZGMtODEyMzc0 | ||
141 | self.assertFalse(rest) | ||
142 | self.assertTrue(keyid.prettyPrint()) | ||
143 | self.assertEqual(attrVal0, der_encoder(keyid)) | ||
144 | - self.assertEqual(str2octs('ptf-kdc-812374'), keyid) | ||
145 | + self.assertEqual(b'ptf-kdc-812374', keyid) | ||
146 | |||
147 | def testOpenTypes(self): | ||
148 | substrate = pem.readBase64fromText(self.encrypted_key_pkg_pem_text) | ||
149 | @@ -86,8 +85,8 @@ YIZIAWUCAQVCMRAEDnB0Zi1rZGMtODEyMzc0 | ||
150 | self.assertNotEqual('0x', attr['attrValues'][0].prettyPrint()[:2]) | ||
151 | |||
152 | if attr['attrType'] == rfc6032.id_aa_KP_contentDecryptKeyID: | ||
153 | - self.assertEqual(str2octs( | ||
154 | - 'ptf-kdc-812374'), attr['attrValues'][0]) | ||
155 | + self.assertEqual( | ||
156 | + b'ptf-kdc-812374', attr['attrValues'][0]) | ||
157 | |||
158 | |||
159 | suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__]) | ||
160 | diff --git a/tests/test_rfc6120.py b/tests/test_rfc6120.py | ||
161 | index bdedab8..a621745 100644 | ||
162 | --- a/tests/test_rfc6120.py | ||
163 | +++ b/tests/test_rfc6120.py | ||
164 | @@ -10,7 +10,6 @@ import unittest | ||
165 | |||
166 | from pyasn1.codec.der.decoder import decode as der_decoder | ||
167 | from pyasn1.codec.der.encoder import encode as der_encoder | ||
168 | -from pyasn1.compat.octets import str2octs | ||
169 | |||
170 | from pyasn1_modules import pem | ||
171 | from pyasn1_modules import rfc5280 | ||
diff --git a/meta-python/recipes-devtools/python/python3-pyasn1-modules_0.4.1.bb b/meta-python/recipes-devtools/python/python3-pyasn1-modules_0.4.1.bb index e8c0f960a..03097801b 100644 --- a/meta-python/recipes-devtools/python/python3-pyasn1-modules_0.4.1.bb +++ b/meta-python/recipes-devtools/python/python3-pyasn1-modules_0.4.1.bb | |||
@@ -6,6 +6,7 @@ HOMEPAGE = "https://github.com/etingof/pyasn1-modules" | |||
6 | LICENSE = "BSD-2-Clause" | 6 | LICENSE = "BSD-2-Clause" |
7 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=190f79253908c986e6cacf380c3a5f6d" | 7 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=190f79253908c986e6cacf380c3a5f6d" |
8 | 8 | ||
9 | SRC_URI += "file://0001-Stop-using-pyasn1.compat.octets.patch" | ||
9 | SRC_URI[sha256sum] = "c28e2dbf9c06ad61c71a075c7e0f9fd0f1b0bb2d2ad4377f240d33ac2ab60a7c" | 10 | SRC_URI[sha256sum] = "c28e2dbf9c06ad61c71a075c7e0f9fd0f1b0bb2d2ad4377f240d33ac2ab60a7c" |
10 | 11 | ||
11 | PYPI_PACKAGE = "pyasn1_modules" | 12 | PYPI_PACKAGE = "pyasn1_modules" |