aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/backends')
-rw-r--r--tests/hazmat/backends/test_openssl.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index ef7560f7..1fd513d5 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -20,7 +20,7 @@ import pytest
from cryptography import utils
from cryptography.exceptions import UnsupportedAlgorithm, InternalError
from cryptography.hazmat.backends.openssl.backend import backend, Backend
-from cryptography.hazmat.primitives import interfaces
+from cryptography.hazmat.primitives import interfaces, hashes
from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from cryptography.hazmat.primitives.ciphers.modes import CBC
@@ -246,6 +246,12 @@ class TestOpenSSL(object):
b"data not multiple of block length"
)
+ def test_derive_pbkdf2_raises_unsupported_on_old_openssl(self):
+ if backend.pbkdf2_hmac_supported(hashes.SHA256()):
+ pytest.skip("Requires an older OpenSSL")
+ with pytest.raises(UnsupportedAlgorithm):
+ backend.derive_pbkdf2_hmac(hashes.SHA256(), 10, b"", 1000, b"")
+
# This test is not in the next class because to check if it's really
# default we don't want to run the setup_method before it
def test_osrandom_engine_is_default(self):