aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-03-01 09:37:12 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-03-01 09:37:12 -0800
commit224ea6ca7533928814d6019a7d8e3e7ce016d601 (patch)
tree3616c79046de197726e6f222130e088a8caf3b40
parente5dadb2d3c6c0e7062dc73f8a50aa6f7b457b64f (diff)
downloadcryptography-224ea6ca7533928814d6019a7d8e3e7ce016d601.tar.gz
cryptography-224ea6ca7533928814d6019a7d8e3e7ce016d601.tar.bz2
cryptography-224ea6ca7533928814d6019a7d8e3e7ce016d601.zip
Change exception in use
-rw-r--r--cryptography/hazmat/primitives/twofactor/hotp.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/cryptography/hazmat/primitives/twofactor/hotp.py b/cryptography/hazmat/primitives/twofactor/hotp.py
index 24f5f465..ed0488f9 100644
--- a/cryptography/hazmat/primitives/twofactor/hotp.py
+++ b/cryptography/hazmat/primitives/twofactor/hotp.py
@@ -17,7 +17,7 @@ import struct
import six
-from cryptography.exceptions import InvalidToken, UnsupportedAlgorithm
+from cryptography.exceptions import InvalidToken
from cryptography.hazmat.primitives import constant_time, hmac
from cryptography.hazmat.primitives.hashes import SHA1, SHA256, SHA512
@@ -31,8 +31,7 @@ class HOTP(object):
raise ValueError("Length of HOTP has to be between 6 to 8.")
if not isinstance(algorithm, (SHA1, SHA256, SHA512)):
- raise UnsupportedAlgorithm(
- "Algorithm must be SHA1, SHA256 or SHA512")
+ raise ValueError("Algorithm must be SHA1, SHA256 or SHA512")
self._key = key
self._length = length