From 224ea6ca7533928814d6019a7d8e3e7ce016d601 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 1 Mar 2014 09:37:12 -0800 Subject: Change exception in use --- cryptography/hazmat/primitives/twofactor/hotp.py | 5 ++--- 1 file 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 -- cgit v1.2.3