summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2026-04-13 17:22:51 +0200
committerGyorgy Sarvari <skandigraun@gmail.com>2026-04-13 17:30:24 +0200
commit6971622747f2c9ce00428f14340068edcacc8d79 (patch)
treea03927ce9a56038813385461269c378808cbf85d /meta-python/recipes-devtools/python
parent5fcddafe237015a0bf9852dcf013b17fb3c6df2b (diff)
downloadmeta-openembedded-6971622747f2c9ce00428f14340068edcacc8d79.tar.gz
python3-cbor2: more patch indent and test fixes
Similar to a previous patch, the CVE-2025-68131 patch contained some more indentation errors, in the tests. Also, the backported tests were inserted between an existing test and its parameters - a new patch corrects that. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python')
-rw-r--r--meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch48
-rw-r--r--meta-python/recipes-devtools/python/python3-cbor2/CVE-2025-68131.patch8
-rw-r--r--meta-python/recipes-devtools/python/python3-cbor2_5.4.2.bb1
3 files changed, 53 insertions, 4 deletions
diff --git a/meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch b/meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch
new file mode 100644
index 0000000000..db5f4c6250
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cbor2/0001-fix-test-parameterization.patch
@@ -0,0 +1,48 @@
1From ff1a6be09b6856b34b30b00542a06819402094c6 Mon Sep 17 00:00:00 2001
2From: Gyorgy Sarvari <skandigraun@gmail.com>
3Date: Mon, 13 Apr 2026 17:16:43 +0200
4Subject: [PATCH] fix test parameterization
5
6The patch for CVE-2025-68131 backported the tests in a way
7that inserted a new, not-parameterized test between another
8parameterized test and this test's parameters. Due to this
9the parameters were associated with the incorrect test, failing
10the execution.
11
12Fix that.
13
14Upstream-Status: Backport [https://github.com/agronholm/cbor2/commit/f1d701cd2c411ee40bb1fe383afe7f365f35abf0]
15Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
16---
17 tests/test_decoder.py | 11 ++++++-----
18 1 file changed, 6 insertions(+), 5 deletions(-)
19
20diff --git a/tests/test_decoder.py b/tests/test_decoder.py
21index cc3af11..f9b7a11 100644
22--- a/tests/test_decoder.py
23+++ b/tests/test_decoder.py
24@@ -709,11 +709,6 @@ def test_reserved_special_tags(impl, data, expected):
25 assert exc_info.value.args[0] == "Undefined Reserved major type 7 subtype 0x" + expected
26
27
28-@pytest.mark.parametrize('data, expected', [
29- ('c400', '4'), ('c500', '5')
30- ],
31-)
32-
33 class TestDecoderReuse:
34 """
35 Tests for correct behavior when reusing CBORDecoder instances.
36@@ -775,6 +770,12 @@ class TestDecoderReuse:
37 assert result == ["hello", "hello"]
38 assert result[0] is result[1] # Same object reference
39
40+
41+@pytest.mark.parametrize('data, expected', [
42+ ('c400', '4'), ('c500', '5')
43+ ],
44+)
45+
46 def test_decimal_payload_unpacking(impl, data, expected):
47 with pytest.raises(impl.CBORDecodeValueError) as exc_info:
48 impl.loads(unhexlify(data))
diff --git a/meta-python/recipes-devtools/python/python3-cbor2/CVE-2025-68131.patch b/meta-python/recipes-devtools/python/python3-cbor2/CVE-2025-68131.patch
index 8556c5bdbc..a87d901727 100644
--- a/meta-python/recipes-devtools/python/python3-cbor2/CVE-2025-68131.patch
+++ b/meta-python/recipes-devtools/python/python3-cbor2/CVE-2025-68131.patch
@@ -411,7 +411,7 @@ index d03e288..cc3af11 100644
411+ decoder.decode_from_bytes(msg2) 411+ decoder.decode_from_bytes(msg2)
412+ 412+
413+ def test_shared_refs_within_single_decode(self, impl): 413+ def test_shared_refs_within_single_decode(self, impl):
414+ """ 414+ """
415+ Shared references must work correctly within a single decode operation. 415+ Shared references must work correctly within a single decode operation.
416+ 416+
417+ Note: This tests non-cyclic sibling references [shareable(x), sharedref(0)], 417+ Note: This tests non-cyclic sibling references [shareable(x), sharedref(0)],
@@ -420,7 +420,7 @@ index d03e288..cc3af11 100644
420+ """ 420+ """
421+ # [shareable("hello"), sharedref(0)] -> ["hello", "hello"] 421+ # [shareable("hello"), sharedref(0)] -> ["hello", "hello"]
422+ data = unhexlify( 422+ data = unhexlify(
423+ "82" # array(2) 423+ "82" # array(2)
424+ "d81c" # tag(28) shareable 424+ "d81c" # tag(28) shareable
425+ "65" # text(5) 425+ "65" # text(5)
426+ "68656c6c6f" # "hello" 426+ "68656c6c6f" # "hello"
@@ -475,7 +475,7 @@ index 8c40000..c76d5e0 100644
475+ encode_to_bytes should also reset shared container tracking between calls. 475+ encode_to_bytes should also reset shared container tracking between calls.
476+ """ 476+ """
477+ fp = BytesIO() 477+ fp = BytesIO()
478+ encoder = impl.CBOREncoder(fp, value_sharing=True) 478+ encoder = impl.CBOREncoder(fp, value_sharing=True)
479+ shared_obj = ["hello"] 479+ shared_obj = ["hello"]
480+ 480+
481+ # First encode 481+ # First encode
@@ -483,7 +483,7 @@ index 8c40000..c76d5e0 100644
483+ 483+
484+ # Second encode should produce valid standalone CBOR 484+ # Second encode should produce valid standalone CBOR
485+ result_bytes = encoder.encode_to_bytes(shared_obj) 485+ result_bytes = encoder.encode_to_bytes(shared_obj)
486+ result = impl.loads(result_bytes) 486+ result = impl.loads(result_bytes)
487+ assert result == ["hello"] 487+ assert result == ["hello"]
488+ 488+
489+ def test_encoder_hook_does_not_reset_state(self, impl): 489+ def test_encoder_hook_does_not_reset_state(self, impl):
diff --git a/meta-python/recipes-devtools/python/python3-cbor2_5.4.2.bb b/meta-python/recipes-devtools/python/python3-cbor2_5.4.2.bb
index 5aeb82b992..9a3218607d 100644
--- a/meta-python/recipes-devtools/python/python3-cbor2_5.4.2.bb
+++ b/meta-python/recipes-devtools/python/python3-cbor2_5.4.2.bb
@@ -11,6 +11,7 @@ inherit pypi python_setuptools_build_meta ptest
11SRC_URI += " \ 11SRC_URI += " \
12 file://run-ptest \ 12 file://run-ptest \
13 file://CVE-2025-68131.patch \ 13 file://CVE-2025-68131.patch \
14 file://0001-fix-test-parameterization.patch \
14" 15"
15 16
16# not vulnerable yet, vulnerability was introduced in v5.6.0 17# not vulnerable yet, vulnerability was introduced in v5.6.0