aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Reid <dreid@dreid.org>2014-01-28 16:51:49 -0800
committerDavid Reid <dreid@dreid.org>2014-02-03 10:05:27 -0800
commitf3f8df349f78b38a9a713030e25b7a238e32cb21 (patch)
tree220d19d411ad0316de7d87c6dba9b64008d0f34b /tests
parente03a289ee46347a4765ff486d58f0c04f56af21b (diff)
downloadcryptography-f3f8df349f78b38a9a713030e25b7a238e32cb21.tar.gz
cryptography-f3f8df349f78b38a9a713030e25b7a238e32cb21.tar.bz2
cryptography-f3f8df349f78b38a9a713030e25b7a238e32cb21.zip
Complete test coverage
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/primitives/test_hkdf.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_hkdf.py b/tests/hazmat/primitives/test_hkdf.py
index 171cf552..f3345b05 100644
--- a/tests/hazmat/primitives/test_hkdf.py
+++ b/tests/hazmat/primitives/test_hkdf.py
@@ -63,6 +63,32 @@ class TestHKDF(object):
with pytest.raises(exceptions.AlreadyFinalized):
hkdf.verify(b"\x02" * 16, b"gJ\xfb{\xb1Oi\xc5sMC\xb7\xe4@\xf7u")
+ hkdf = HKDF(
+ hashes.SHA256(),
+ 16,
+ salt=None,
+ info=None,
+ backend=backend
+ )
+
+ hkdf.extract(b"\x01" * 16)
+
+ with pytest.raises(exceptions.AlreadyFinalized):
+ hkdf.extract(b"\x02" * 16)
+
+ hkdf = HKDF(
+ hashes.SHA256(),
+ 16,
+ salt=None,
+ info=None,
+ backend=backend
+ )
+
+ hkdf.expand(b"\x01" * 16)
+
+ with pytest.raises(exceptions.AlreadyFinalized):
+ hkdf.expand(b"\x02" * 16)
+
def test_verify(self, backend):
hkdf = HKDF(
hashes.SHA256(),