aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-03-02 09:10:40 -0430
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-03-02 09:10:40 -0430
commit43b4f1c43298ee8804396c89f1684a1012b87ead (patch)
tree83a7cacc9c717c36cdded66154e115deeec9a659 /cryptography
parent48610a5190286ce59204fecf096d217abaf4ed23 (diff)
parent9b1a82e42bdd546220225430aa06e3b732fb0155 (diff)
downloadcryptography-43b4f1c43298ee8804396c89f1684a1012b87ead.tar.gz
cryptography-43b4f1c43298ee8804396c89f1684a1012b87ead.tar.bz2
cryptography-43b4f1c43298ee8804396c89f1684a1012b87ead.zip
Merge pull request #703 from alex/change-exceptino-type
Change exception in use
Diffstat (limited to 'cryptography')
-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..88bde715 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 TypeError("Algorithm must be SHA1, SHA256 or SHA512")
self._key = key
self._length = length