aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-02-04 16:21:48 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-02-04 16:21:48 -0800
commit09d08ae07a72506b81bc640a2af70397f3ab2594 (patch)
tree7c5a810630a5417913be50e788fd5024a33ff129 /tests
parente45826f8dc75dd159582ecc15dfc7626ef908a1f (diff)
downloadcryptography-09d08ae07a72506b81bc640a2af70397f3ab2594.tar.gz
cryptography-09d08ae07a72506b81bc640a2af70397f3ab2594.tar.bz2
cryptography-09d08ae07a72506b81bc640a2af70397f3ab2594.zip
Made OpenSSL's derive_pbkdf2_hmac raise the right exception
Diffstat (limited to 'tests')
-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 9f00364f..ea04c133 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -16,7 +16,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
@@ -146,3 +146,9 @@ class TestOpenSSL(object):
b"error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:"
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"")