aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorAyrx <terrycwk1994@gmail.com>2014-02-13 18:52:31 +0800
committerAyrx <terrycwk1994@gmail.com>2014-02-21 11:13:35 +0800
commitb5189afaf1dd1c06edd0efe3d6791ea7c40e31c7 (patch)
tree5d19ddb2ff150be98f22f104acaea3da44e82a08 /cryptography
parent25b1d21b40f531450877bcfbee55406b28111dca (diff)
downloadcryptography-b5189afaf1dd1c06edd0efe3d6791ea7c40e31c7.tar.gz
cryptography-b5189afaf1dd1c06edd0efe3d6791ea7c40e31c7.tar.bz2
cryptography-b5189afaf1dd1c06edd0efe3d6791ea7c40e31c7.zip
Added a max limit of 8 on length parameter. Updated documentation.
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/oath/hotp.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cryptography/hazmat/oath/hotp.py b/cryptography/hazmat/oath/hotp.py
index a1f62746..9f5a0f13 100644
--- a/cryptography/hazmat/oath/hotp.py
+++ b/cryptography/hazmat/oath/hotp.py
@@ -25,8 +25,8 @@ class HOTP(object):
if len(key) < 16:
raise ValueError("Key length has to be at least 128 bits.")
- if length < 6:
- raise ValueError("Length of HOTP has to be at least 6.")
+ if length < 6 or length > 8:
+ raise ValueError("Length of HOTP has to be between 6 to 8.")
self._key = key
self._length = length