From 5b83d9bf238343621e9bc6d2ba459652cd3a01b7 Mon Sep 17 00:00:00 2001 From: Ayrx Date: Mon, 3 Mar 2014 23:33:49 +0800 Subject: Added length type check to HOTP and corresponding test --- tests/hazmat/primitives/twofactor/test_hotp.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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) -- cgit v1.2.3