diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-03-15 11:57:32 -0430 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-03-15 11:57:32 -0430 |
commit | d49eae65a42ea08719253bed400fe81203bf7d38 (patch) | |
tree | 3a9de2deb5ab0702d61038cfc5f10c12250b8c21 /tests/hazmat/primitives/test_hkdf.py | |
parent | c56b3a10d52017fd95bdb8a97c343ef4096e6537 (diff) | |
parent | 35afbcb3fd5b45b91c34395c031ea4cf15a39244 (diff) | |
download | cryptography-d49eae65a42ea08719253bed400fe81203bf7d38.tar.gz cryptography-d49eae65a42ea08719253bed400fe81203bf7d38.tar.bz2 cryptography-d49eae65a42ea08719253bed400fe81203bf7d38.zip |
Merge pull request #799 from Ayrx/add-backend-check-to-kdf
Added backend check to kdf primitives
Diffstat (limited to 'tests/hazmat/primitives/test_hkdf.py')
-rw-r--r-- | tests/hazmat/primitives/test_hkdf.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/hazmat/primitives/test_hkdf.py b/tests/hazmat/primitives/test_hkdf.py index e3e2a9df..42c75c65 100644 --- a/tests/hazmat/primitives/test_hkdf.py +++ b/tests/hazmat/primitives/test_hkdf.py @@ -17,7 +17,9 @@ import six import pytest -from cryptography.exceptions import AlreadyFinalized, InvalidKey +from cryptography.exceptions import ( + AlreadyFinalized, InvalidKey, UnsupportedInterface) + from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.kdf.hkdf import HKDF @@ -145,3 +147,10 @@ class TestHKDF(object): ) hkdf.verify(b"foo", six.u("bar")) + + +def test_invalid_backend(): + pretend_backend = object() + + with pytest.raises(UnsupportedInterface): + HKDF(hashes.SHA256(), 16, None, None, pretend_backend) |