From 69617caca7ff98f1a991b476669f1afcdfb01fb0 Mon Sep 17 00:00:00 2001 From: Terry Chia Date: Sat, 16 Jul 2016 22:22:32 +0800 Subject: Add flag to toggle key length check for HOTP and TOTP. (#3012) * Add an enforce_key_length parameter to HOTP and TOTP. * Document changes in docs. * Add some words to the wordlist. * Add versionadded to docs. --- tests/hazmat/primitives/twofactor/test_hotp.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/hazmat/primitives/twofactor/test_hotp.py b/tests/hazmat/primitives/twofactor/test_hotp.py index ab5f93c5..4c561f70 100644 --- a/tests/hazmat/primitives/twofactor/test_hotp.py +++ b/tests/hazmat/primitives/twofactor/test_hotp.py @@ -35,6 +35,10 @@ class TestHOTP(object): with pytest.raises(ValueError): HOTP(secret, 6, SHA1(), backend) + def test_unenforced_invalid_kwy_length(self, backend): + secret = os.urandom(10) + HOTP(secret, 6, SHA1(), backend, enforce_key_length=False) + def test_invalid_hotp_length(self, backend): secret = os.urandom(16) -- cgit v1.2.3