aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2024-02-08 08:51:21 -0600
committerGitHub <noreply@github.com>2024-02-08 14:51:21 +0000
commitb6934e7301d3401ee7f4dcb153f8fa265f577bbf (patch)
treee4f1f3f357d87fb994a7b0ec019a7c4e9b482aa0 /tests
parent92a79c95aed4290436e8299e5896497aeb0db749 (diff)
downloadpyca-cryptography-b6934e7301d3401ee7f4dcb153f8fa265f577bbf.zip
pyca-cryptography-b6934e7301d3401ee7f4dcb153f8fa265f577bbf.tar.gz
pyca-cryptography-b6934e7301d3401ee7f4dcb153f8fa265f577bbf.tar.bz2
smaller mmap in tests to fit in a 32-bit ssize_t (#10365)
this still triggers the overflows we expect in the tests and should also work on 32-bit systems
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/primitives/test_aead.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/hazmat/primitives/test_aead.py b/tests/hazmat/primitives/test_aead.py
index a1f99ab..7b8eebb 100644
--- a/tests/hazmat/primitives/test_aead.py
+++ b/tests/hazmat/primitives/test_aead.py
@@ -38,7 +38,11 @@ def _aead_supported(cls):
def large_mmap():
- return mmap.mmap(-1, 2**32, prot=mmap.PROT_READ)
+ # We need this large but not larger than fits in a 32-bit int. This way
+ # a 32-bit platform can return this mmap successfully but we'll raise
+ # OverFlowError in the tests because the underlying type for the
+ # function signature is a signed int
+ return mmap.mmap(-1, 2**31, prot=mmap.PROT_READ)
@pytest.mark.skipif(