aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-03-03 10:14:54 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-03-03 10:14:54 -0800
commitc898e8d1328e6c0c65c13923a9581f7b41911ae3 (patch)
tree2b13c903789b4862ebca583c3bf4061e21d50df3 /tests
parent6963d50ff7c867d49bbd62243c3aa0a861a8e7b6 (diff)
parent9ab901df604177ea331b59b94d513af50af8f8e1 (diff)
downloadcryptography-c898e8d1328e6c0c65c13923a9581f7b41911ae3.tar.gz
cryptography-c898e8d1328e6c0c65c13923a9581f7b41911ae3.tar.bz2
cryptography-c898e8d1328e6c0c65c13923a9581f7b41911ae3.zip
Merge pull request #720 from Ayrx/hotp-length-type-check
Added length type check to HOTP and corresponding test
Diffstat (limited to 'tests')
-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)