diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-03-03 10:14:54 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-03-03 10:14:54 -0800 |
commit | c898e8d1328e6c0c65c13923a9581f7b41911ae3 (patch) | |
tree | 2b13c903789b4862ebca583c3bf4061e21d50df3 /tests | |
parent | 6963d50ff7c867d49bbd62243c3aa0a861a8e7b6 (diff) | |
parent | 9ab901df604177ea331b59b94d513af50af8f8e1 (diff) | |
download | cryptography-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.py | 6 |
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) |