aports/community/py3-cryptography/skip-aead-tests-on-32-bit.patch

67 lines
2.6 KiB
Diff

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)