aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_block.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-12-06 14:26:08 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-12-06 14:26:08 -0800
commitb5c4891e0c2e30118641092aff975e8d0e63cbab (patch)
treeb6209797e16ed81a5021fa6172e47ce2ebd94e1d /tests/hazmat/primitives/test_block.py
parent07c36baec6ee7d4a89b3cbe18a37b9e5cbe48f64 (diff)
parenta07925a154e2b28db30499c5a3cf40fedc451d10 (diff)
downloadcryptography-b5c4891e0c2e30118641092aff975e8d0e63cbab.tar.gz
cryptography-b5c4891e0c2e30118641092aff975e8d0e63cbab.tar.bz2
cryptography-b5c4891e0c2e30118641092aff975e8d0e63cbab.zip
Merge pull request #285 from reaperhulk/fix-282
raise ValueErrors when supplying/not supplying tags for GCM
Diffstat (limited to 'tests/hazmat/primitives/test_block.py')
-rw-r--r--tests/hazmat/primitives/test_block.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py
index 2806efd5..02de3861 100644
--- a/tests/hazmat/primitives/test_block.py
+++ b/tests/hazmat/primitives/test_block.py
@@ -26,7 +26,9 @@ from cryptography.hazmat.primitives.ciphers import (
Cipher, algorithms, modes
)
-from .utils import generate_aead_exception_test
+from .utils import (
+ generate_aead_exception_test, generate_aead_tag_exception_test
+)
@utils.register_interface(interfaces.CipherAlgorithm)
@@ -135,3 +137,11 @@ class TestAEADCipherContext(object):
),
skip_message="Does not support AES GCM",
)
+ test_aead_tag_exceptions = generate_aead_tag_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",
+ )