diff options
Diffstat (limited to 'cryptography/hazmat')
-rw-r--r-- | cryptography/hazmat/primitives/twofactor/hotp.py | 6 | ||||
-rw-r--r-- | cryptography/hazmat/primitives/twofactor/totp.py | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/cryptography/hazmat/primitives/twofactor/hotp.py b/cryptography/hazmat/primitives/twofactor/hotp.py index bac23d1b..41c467c8 100644 --- a/cryptography/hazmat/primitives/twofactor/hotp.py +++ b/cryptography/hazmat/primitives/twofactor/hotp.py @@ -17,7 +17,9 @@ import struct import six -from cryptography.exceptions import InvalidToken, UnsupportedAlgorithm, _Causes +from cryptography.exceptions import ( + InvalidToken, UnsupportedAlgorithm, _Reasons +) from cryptography.hazmat.backends.interfaces import HMACBackend from cryptography.hazmat.primitives import constant_time, hmac from cryptography.hazmat.primitives.hashes import SHA1, SHA256, SHA512 @@ -28,7 +30,7 @@ class HOTP(object): if not isinstance(backend, HMACBackend): raise UnsupportedAlgorithm( "Backend object does not implement HMACBackend", - _Causes.BACKEND_MISSING_INTERFACE + _Reasons.BACKEND_MISSING_INTERFACE ) if len(key) < 16: diff --git a/cryptography/hazmat/primitives/twofactor/totp.py b/cryptography/hazmat/primitives/twofactor/totp.py index d0162395..e55ba00d 100644 --- a/cryptography/hazmat/primitives/twofactor/totp.py +++ b/cryptography/hazmat/primitives/twofactor/totp.py @@ -13,7 +13,9 @@ from __future__ import absolute_import, division, print_function -from cryptography.exceptions import InvalidToken, UnsupportedAlgorithm, _Causes +from cryptography.exceptions import ( + InvalidToken, UnsupportedAlgorithm, _Reasons +) from cryptography.hazmat.backends.interfaces import HMACBackend from cryptography.hazmat.primitives import constant_time from cryptography.hazmat.primitives.twofactor.hotp import HOTP @@ -24,7 +26,7 @@ class TOTP(object): if not isinstance(backend, HMACBackend): raise UnsupportedAlgorithm( "Backend object does not implement HMACBackend", - _Causes.BACKEND_MISSING_INTERFACE + _Reasons.BACKEND_MISSING_INTERFACE ) self._time_step = time_step |