From 486eca55e47702a2242d723b2aa048d3a297ab1d Mon Sep 17 00:00:00 2001 From: Tasos Sahanidis Date: Fri, 19 Apr 2024 05:02:11 +0300 Subject: extra/python-cryptography: Patch out broken tests https://git.alpinelinux.org/aports/commit/community/py3-cryptography/skip-aead-tests-on-32-bit.patch?id=696cbb6a06d0869bb285ad4a5650bf62e8e29ebe --- extra/python-cryptography/PKGBUILD | 3 + .../skip-aead-tests-on-32-bit.patch | 67 ++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 extra/python-cryptography/PKGBUILD create mode 100644 extra/python-cryptography/skip-aead-tests-on-32-bit.patch (limited to 'extra/python-cryptography') diff --git a/extra/python-cryptography/PKGBUILD b/extra/python-cryptography/PKGBUILD new file mode 100644 index 00000000..c42f0881 --- /dev/null +++ b/extra/python-cryptography/PKGBUILD @@ -0,0 +1,3 @@ +source+=('skip-aead-tests-on-32-bit.patch') +sha512sums+=('SKIP') +eval "$(declare -f prepare | sed 's@cd cryptography@cd cryptography; patch -p1 -i ../skip-aead-tests-on-32-bit.patch@')" diff --git a/extra/python-cryptography/skip-aead-tests-on-32-bit.patch b/extra/python-cryptography/skip-aead-tests-on-32-bit.patch new file mode 100644 index 00000000..95695554 --- /dev/null +++ b/extra/python-cryptography/skip-aead-tests-on-32-bit.patch @@ -0,0 +1,67 @@ +https://git.alpinelinux.org/aports/commit/community/py3-cryptography/skip-aead-tests-on-32-bit.patch?id=696cbb6a06d0869bb285ad4a5650bf62e8e29ebe +Adapted from https://github.com/pyca/cryptography/commit/4e7c2c72efe5b1fbb2c47d1341c5b4c7cbdb6a57 +-- +diff --git a/tests/hazmat/primitives/test_aead.py b/tests/hazmat/primitives/test_aead.py +index 7b8eebb78447..2f0d52d82682 100644 +--- a/tests/hazmat/primitives/test_aead.py ++++ b/tests/hazmat/primitives/test_aead.py +@@ -60,7 +56,8 @@ def test_chacha20poly1305_unsupported_on_older_openssl(backend): + ) + class TestChaCha20Poly1305: + @pytest.mark.skipif( +- sys.platform not in {"linux", "darwin"}, reason="mmap required" ++ sys.platform not in {"linux", "darwin"} or sys.maxsize < 2**31, ++ reason="mmap and 64-bit platform required", + ) + def test_data_too_large(self): + key = ChaCha20Poly1305.generate_key() +@@ -201,7 +198,8 @@ def test_buffer_protocol(self, backend): + ) + class TestAESCCM: + @pytest.mark.skipif( +- sys.platform not in {"linux", "darwin"}, reason="mmap required" ++ sys.platform not in {"linux", "darwin"} or sys.maxsize < 2**31, ++ reason="mmap and 64-bit platform required", + ) + def test_data_too_large(self): + key = AESCCM.generate_key(128) +@@ -382,7 +380,8 @@ def _load_gcm_vectors(): + + class TestAESGCM: + @pytest.mark.skipif( +- sys.platform not in {"linux", "darwin"}, reason="mmap required" ++ sys.platform not in {"linux", "darwin"} or sys.maxsize < 2**31, ++ reason="mmap and 64-bit platform required", + ) + def test_data_too_large(self): + key = AESGCM.generate_key(128) +@@ -529,7 +528,8 @@ def test_aesocb3_unsupported_on_older_openssl(backend): + ) + class TestAESOCB3: + @pytest.mark.skipif( +- sys.platform not in {"linux", "darwin"}, reason="mmap required" ++ sys.platform not in {"linux", "darwin"} or sys.maxsize < 2**31, ++ reason="mmap and 64-bit platform required", + ) + def test_data_too_large(self): + key = AESOCB3.generate_key(128) +@@ -704,7 +704,8 @@ def test_buffer_protocol(self, backend): + ) + class TestAESSIV: + @pytest.mark.skipif( +- sys.platform not in {"linux", "darwin"}, reason="mmap required" ++ sys.platform not in {"linux", "darwin"} or sys.maxsize < 2**31, ++ reason="mmap and 64-bit platform required", + ) + def test_data_too_large(self): + key = AESSIV.generate_key(256) +@@ -848,7 +849,8 @@ def test_buffer_protocol(self, backend): + ) + class TestAESGCMSIV: + @pytest.mark.skipif( +- sys.platform not in {"linux", "darwin"}, reason="mmap required" ++ sys.platform not in {"linux", "darwin"} or sys.maxsize < 2**31, ++ reason="mmap and 64-bit platform required", + ) + def test_data_too_large(self): + key = AESGCMSIV.generate_key(256) -- cgit v1.2.3-70-g09d2