diff options
-rw-r--r-- | cryptography/hazmat/primitives/kdf/hkdf.py | 8 | ||||
-rw-r--r-- | tests/hazmat/primitives/utils.py | 2 |
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"]) |