diff options
| author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2020-10-25 06:15:18 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-25 09:15:18 -0400 |
| commit | 836a92a28fbe9df8c37121e340b91ed9cd519ddd (patch) | |
| tree | 452be9d72ae7728e9929c97cdc0fde0515a2a674 /tests | |
| parent | 085d1e44c6fe0480a4f67c34caf747943f4a2f20 (diff) | |
| download | cryptography-836a92a28fbe9df8c37121e340b91ed9cd519ddd.tar.gz | |
chunking didn't actually work (#5499)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hazmat/primitives/test_ciphers.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_ciphers.py b/tests/hazmat/primitives/test_ciphers.py index 104e679e5..4d82f0c13 100644 --- a/tests/hazmat/primitives/test_ciphers.py +++ b/tests/hazmat/primitives/test_ciphers.py @@ -333,3 +333,12 @@ class TestCipherUpdateInto(object): decbuf = bytearray(527) decprocessed = decryptor.update_into(buf[:processed], decbuf) assert decbuf[:decprocessed] == pt + + def test_max_chunk_size_fits_in_int32(self, backend): + # max chunk must fit in signed int32 or else a call large enough to + # cause chunking will result in the very OverflowError we want to + # avoid with chunking. + key = b"\x00" * 16 + c = ciphers.Cipher(AES(key), modes.ECB(), backend) + encryptor = c.encryptor() + backend._ffi.new("int *", encryptor._ctx._MAX_CHUNK_SIZE) |
