aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-05-03 16:41:30 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2017-05-03 17:41:30 -0400
commit92f570eabe713653e5fe2dc9ba666493df047ccb (patch)
treeccc909d2897e0943a676f4e77bb5a9ec8ef4fcd8 /tests
parent5fb10210276a10f104318504aa81d2ba9c42cba8 (diff)
downloadcryptography-92f570eabe713653e5fe2dc9ba666493df047ccb.tar.gz
cryptography-92f570eabe713653e5fe2dc9ba666493df047ccb.tar.bz2
cryptography-92f570eabe713653e5fe2dc9ba666493df047ccb.zip
use openssl constants (#3534)
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/primitives/test_aes.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/hazmat/primitives/test_aes.py b/tests/hazmat/primitives/test_aes.py
index 392a847f..a130e054 100644
--- a/tests/hazmat/primitives/test_aes.py
+++ b/tests/hazmat/primitives/test_aes.py
@@ -317,8 +317,11 @@ class TestAESModeGCM(object):
encryptor.authenticate_additional_data(aad)
encryptor.finalize()
- if backend.name == "openssl" and \
- backend.openssl_version_number() < 0x10002000:
+ if (
+ backend.name == "openssl" and
+ backend._lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 and
+ not backend._lib.CRYPTOGRAPHY_IS_LIBRESSL
+ ):
with pytest.raises(NotImplementedError):
decryptor = base.Cipher(
algorithms.AES(key),
@@ -371,8 +374,11 @@ class TestAESModeGCM(object):
encryptor.finalize()
tag = encryptor.tag
- if backend.name == "openssl" and \
- backend.openssl_version_number() < 0x10002000:
+ if (
+ backend.name == "openssl" and
+ backend._lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 and
+ not backend._lib.CRYPTOGRAPHY_IS_LIBRESSL
+ ):
with pytest.raises(NotImplementedError):
decryptor = base.Cipher(
algorithms.AES(key),
@@ -392,8 +398,11 @@ class TestAESModeGCM(object):
).decryptor()
decryptor.authenticate_additional_data(aad)
- if backend.name == "openssl" and \
- backend.openssl_version_number() < 0x10002000:
+ if (
+ backend.name == "openssl" and
+ backend._lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 and
+ not backend._lib.CRYPTOGRAPHY_IS_LIBRESSL
+ ):
with pytest.raises(NotImplementedError):
decryptor.finalize_with_tag(tag)
decryptor.finalize()