aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/twofactor/test_hotp.py
diff options
context:
space:
mode:
authorAyrx <terrycwk1994@gmail.com>2014-03-03 23:33:49 +0800
committerAyrx <terrycwk1994@gmail.com>2014-03-03 23:33:49 +0800
commit5b83d9bf238343621e9bc6d2ba459652cd3a01b7 (patch)
tree703bf2193797a6b1d10f83d8681c2b9e4e9deca7 /tests/hazmat/primitives/twofactor/test_hotp.py
parent930eed8bcbea6f6250998f0ee042babd62667a9f (diff)
downloadcryptography-5b83d9bf238343621e9bc6d2ba459652cd3a01b7.tar.gz
cryptography-5b83d9bf238343621e9bc6d2ba459652cd3a01b7.tar.bz2
cryptography-5b83d9bf238343621e9bc6d2ba459652cd3a01b7.zip
Added length type check to HOTP and corresponding test
Diffstat (limited to 'tests/hazmat/primitives/twofactor/test_hotp.py')
-rw-r--r--tests/hazmat/primitives/twofactor/test_hotp.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/twofactor/test_hotp.py b/tests/hazmat/primitives/twofactor/test_hotp.py
index 4c726b77..0f8c4a53 100644
--- a/tests/hazmat/primitives/twofactor/test_hotp.py
+++ b/tests/hazmat/primitives/twofactor/test_hotp.py
@@ -87,3 +87,9 @@ class TestHOTP(object):
with pytest.raises(InvalidToken):
hotp.verify(b"123456", counter)
+
+ def test_length_not_int(self, backend):
+ secret = b"12345678901234567890"
+
+ with pytest.raises(TypeError):
+ HOTP(secret, b"foo", SHA1(), backend)