aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_block.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2013-11-20 21:27:00 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2013-11-29 17:19:45 -0600
commit22e80cb96e034679750a38702aaa55e30da05f69 (patch)
treea8fa871f152c83c03033f1dab8fed319eb3ec239 /tests/hazmat/primitives/test_block.py
parentbdb6debe4a9a3ccba6648c56028f849c0e5b6a12 (diff)
downloadcryptography-22e80cb96e034679750a38702aaa55e30da05f69.tar.gz
cryptography-22e80cb96e034679750a38702aaa55e30da05f69.tar.bz2
cryptography-22e80cb96e034679750a38702aaa55e30da05f69.zip
GCM support
Diffstat (limited to 'tests/hazmat/primitives/test_block.py')
-rw-r--r--tests/hazmat/primitives/test_block.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py
index f6c44b47..296821a4 100644
--- a/tests/hazmat/primitives/test_block.py
+++ b/tests/hazmat/primitives/test_block.py
@@ -18,12 +18,16 @@ import binascii
import pytest
from cryptography import utils
-from cryptography.exceptions import UnsupportedAlgorithm, AlreadyFinalized
+from cryptography.exceptions import (
+ UnsupportedAlgorithm, AlreadyFinalized,
+)
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.ciphers import (
Cipher, algorithms, modes
)
+from .utils import generate_aead_use_after_finalize_test
+
@utils.register_interface(interfaces.CipherAlgorithm)
class DummyCipher(object):
@@ -120,3 +124,14 @@ class TestCipherContext(object):
decryptor.update(b"1")
with pytest.raises(ValueError):
decryptor.finalize()
+
+
+class TestAEADCipherContext(object):
+ test_use_after_finalize = generate_aead_use_after_finalize_test(
+ algorithms.AES,
+ modes.GCM,
+ only_if=lambda backend: backend.cipher_supported(
+ algorithms.AES("\x00" * 16), modes.GCM("\x00" * 12)
+ ),
+ skip_message="Does not support AES GCM",
+ )