aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAyrx <terrycwk1994@gmail.com>2014-05-09 14:48:06 +0800
committerAyrx <terrycwk1994@gmail.com>2014-05-09 14:48:06 +0800
commit2d6cd449f1ad3448798d77d9216aded95b861a8d (patch)
treefca1dbbb85e0e2ad89d003cc502ef8d244a41bc6
parentac1a079f9baf441c262fd11628f3e3d06f73129d (diff)
downloadcryptography-2d6cd449f1ad3448798d77d9216aded95b861a8d.tar.gz
cryptography-2d6cd449f1ad3448798d77d9216aded95b861a8d.tar.bz2
cryptography-2d6cd449f1ad3448798d77d9216aded95b861a8d.zip
Minor fixes
-rw-r--r--cryptography/hazmat/primitives/kdf/hkdf.py8
-rw-r--r--tests/hazmat/primitives/utils.py2
2 files changed, 2 insertions, 8 deletions
diff --git a/cryptography/hazmat/primitives/kdf/hkdf.py b/cryptography/hazmat/primitives/kdf/hkdf.py
index d49cc5bd..daa8fcc7 100644
--- a/cryptography/hazmat/primitives/kdf/hkdf.py
+++ b/cryptography/hazmat/primitives/kdf/hkdf.py
@@ -45,8 +45,6 @@ class HKDF(object):
self._backend = backend
- self._used = False
-
self._hkdf_expand = HKDFExpand(self._algorithm, length, info, backend)
def _extract(self, key_material):
@@ -61,10 +59,6 @@ class HKDF(object):
"material."
)
- if self._used:
- raise AlreadyFinalized
-
- self._used = True
return self._hkdf_expand.derive(self._extract(key_material))
def verify(self, key_material, expected_key):
@@ -73,7 +67,7 @@ class HKDF(object):
@utils.register_interface(interfaces.KeyDerivationFunction)
-class HKDFExpand(HKDF):
+class HKDFExpand(object):
def __init__(self, algorithm, length, info, backend):
if not isinstance(backend, HMACBackend):
raise UnsupportedAlgorithm(
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py
index 7cf5efd0..a496459b 100644
--- a/tests/hazmat/primitives/utils.py
+++ b/tests/hazmat/primitives/utils.py
@@ -354,7 +354,7 @@ def hkdf_expand_test(backend, algorithm, params):
backend=backend
)
- okm = hkdf._expand(binascii.unhexlify(params["prk"]))
+ okm = hkdf.derive(binascii.unhexlify(params["prk"]))
assert okm == binascii.unhexlify(params["okm"])