aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorDavid Reid <dreid@dreid.org>2014-02-03 10:49:15 -0800
committerDavid Reid <dreid@dreid.org>2014-02-03 10:49:15 -0800
commit6385561ee16742da28dacd1b4dce27baf7f0bb48 (patch)
tree55f4be8ff6101adc3d61791980105dd18e0a9330 /cryptography
parentb9fa7712a751c4b54dd4b9ba54552a66cc89a34e (diff)
downloadcryptography-6385561ee16742da28dacd1b4dce27baf7f0bb48.tar.gz
cryptography-6385561ee16742da28dacd1b4dce27baf7f0bb48.tar.bz2
cryptography-6385561ee16742da28dacd1b4dce27baf7f0bb48.zip
Import exception classes instead of the exceptions module.
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/primitives/kdf/hkdf.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/cryptography/hazmat/primitives/kdf/hkdf.py b/cryptography/hazmat/primitives/kdf/hkdf.py
index ae24f676..c98a31c2 100644
--- a/cryptography/hazmat/primitives/kdf/hkdf.py
+++ b/cryptography/hazmat/primitives/kdf/hkdf.py
@@ -13,12 +13,9 @@
import six
-from cryptography import exceptions
from cryptography import utils
-
-from cryptography.hazmat.primitives import constant_time
-from cryptography.hazmat.primitives import hmac
-from cryptography.hazmat.primitives import interfaces
+from cryptogrpahy.exceptions import AlreadyFinalized, InvalidKey
+from cryptography.hazmat.primitives import constant_time, hmac, interfaces
@utils.register_interface(interfaces.KeyDerivationFunction)
@@ -84,11 +81,11 @@ class HKDF(object):
)
if self._used:
- raise exceptions.AlreadyFinalized
+ raise AlreadyFinalized
self._used = True
return self._expand(self._extract(key_material))
def verify(self, key_material, expected_key):
if not constant_time.bytes_eq(self.derive(key_material), expected_key):
- raise exceptions.InvalidKey
+ raise InvalidKey