diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-11-22 19:57:37 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-11-29 17:19:45 -0600 |
commit | a4bfc08b8d2ed312eeb1b0558ac20f285feb8cc2 (patch) | |
tree | 3548f67d5eb42eaf5ca5b4eda3d661f369fcc399 /tests/hazmat/primitives/utils.py | |
parent | ce9c611feb4db781fcab5b7bbc68b936816d6a73 (diff) | |
download | cryptography-a4bfc08b8d2ed312eeb1b0558ac20f285feb8cc2.tar.gz cryptography-a4bfc08b8d2ed312eeb1b0558ac20f285feb8cc2.tar.bz2 cryptography-a4bfc08b8d2ed312eeb1b0558ac20f285feb8cc2.zip |
invalidtag exception for gcm
This exception is probably not safe. It depends on the assumption that
if ERR_get_error returns a 0 then it is an AEAD tag error.
Diffstat (limited to 'tests/hazmat/primitives/utils.py')
-rw-r--r-- | tests/hazmat/primitives/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py index 8df02e78..39f5ae82 100644 --- a/tests/hazmat/primitives/utils.py +++ b/tests/hazmat/primitives/utils.py @@ -7,7 +7,7 @@ from cryptography.hazmat.bindings import _ALL_BACKENDS from cryptography.hazmat.primitives import hashes, hmac from cryptography.hazmat.primitives.ciphers import Cipher from cryptography.exceptions import ( - AlreadyFinalized, NotYetFinalized, AlreadyUpdated, + AlreadyFinalized, NotYetFinalized, AlreadyUpdated, InvalidTag, ) from ...utils import load_vectors_from_file @@ -95,7 +95,7 @@ def aead_test(backend, cipher_factory, mode_factory, params, only_if, decryptor = cipher.decryptor() decryptor.add_data(binascii.unhexlify(aad)) actual_plaintext = decryptor.update(binascii.unhexlify(ciphertext)) - with pytest.raises(AssertionError): + with pytest.raises(InvalidTag): decryptor.finalize() else: cipher = Cipher( |