aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_block.py
diff options
context:
space:
mode:
authorDavid Reid <dreid@dreid.org>2013-12-04 14:21:53 -0800
committerDavid Reid <dreid@dreid.org>2013-12-04 14:21:53 -0800
commit3029fe414a3dba0231a44e72ddfc398634c173de (patch)
tree4cc5e7a8933a6a916bbf7a2712df143d6e2ceb71 /tests/hazmat/primitives/test_block.py
parentbdb6debe4a9a3ccba6648c56028f849c0e5b6a12 (diff)
parent672843712d6b42404fea27a07a87b70d850cc0dd (diff)
downloadcryptography-3029fe414a3dba0231a44e72ddfc398634c173de.tar.gz
cryptography-3029fe414a3dba0231a44e72ddfc398634c173de.tar.bz2
cryptography-3029fe414a3dba0231a44e72ddfc398634c173de.zip
Merge pull request #176 from reaperhulk/gcm-support
[WIP] 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..2806efd5 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_exception_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_aead_exceptions = generate_aead_exception_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",
+ )