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.
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py
index 8df02e7..39f5ae8 100644
--- a/tests/hazmat/primitives/utils.py
+++ b/tests/hazmat/primitives/utils.py
@@ -7,7 +7,7 @@
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 @@
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(