diff options
author | David Reid <dreid@dreid.org> | 2014-02-04 16:49:28 -0800 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2014-02-04 16:49:28 -0800 |
commit | 6781094003b86c0a6997452876ae63acd49809e1 (patch) | |
tree | 7c5a810630a5417913be50e788fd5024a33ff129 /tests/hazmat/backends/test_openssl.py | |
parent | e45826f8dc75dd159582ecc15dfc7626ef908a1f (diff) | |
parent | 09d08ae07a72506b81bc640a2af70397f3ab2594 (diff) | |
download | cryptography-6781094003b86c0a6997452876ae63acd49809e1.tar.gz cryptography-6781094003b86c0a6997452876ae63acd49809e1.tar.bz2 cryptography-6781094003b86c0a6997452876ae63acd49809e1.zip |
Merge pull request #561 from alex/unsupported-algorithm
Made OpenSSL's derive_pbkdf2_hmac raise the right exception
Diffstat (limited to 'tests/hazmat/backends/test_openssl.py')
-rw-r--r-- | tests/hazmat/backends/test_openssl.py | 8 |
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"") |