From d6b02d410370c439e662e8a2f5741a2d092bab8e Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 28 Jan 2014 21:25:53 -0600 Subject: review fixes --- cryptography/hazmat/primitives/kdf/pbkdf2.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cryptography/hazmat/primitives/kdf/pbkdf2.py b/cryptography/hazmat/primitives/kdf/pbkdf2.py index fec1d5c2..2c8dd541 100644 --- a/cryptography/hazmat/primitives/kdf/pbkdf2.py +++ b/cryptography/hazmat/primitives/kdf/pbkdf2.py @@ -30,7 +30,7 @@ class PBKDF2HMAC(object): "{0} is not supported for PBKDF2 by this backend".format( algorithm.name) ) - self._called = False + self._used = False self.algorithm = algorithm self._length = length if isinstance(salt, six.text_type): @@ -43,10 +43,9 @@ class PBKDF2HMAC(object): self._backend = backend def derive(self, key_material): - if self._called: + if self._used: raise AlreadyFinalized("PBKDF2 instances can only be called once") - else: - self._called = True + self._used = True if isinstance(key_material, six.text_type): raise TypeError( -- cgit v1.2.3