aboutsummaryrefslogtreecommitdiff
path: root/unittest/test_pro.py
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-12-09 13:46:54 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2016-12-09 14:06:50 +0100
commit1d493a5daba996e31615154b28688de3637529c7 (patch)
tree98d893d189aa422ccd3e29e832e89f9d682c15b1 /unittest/test_pro.py
parent87eaf78c7c7290764ccaebe67726b77a44f21240 (diff)
downloadlibnitrokey-1d493a5daba996e31615154b28688de3637529c7.tar.gz
libnitrokey-1d493a5daba996e31615154b28688de3637529c7.tar.bz2
Test null started OTP secrets also for 320bit case
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest/test_pro.py')
-rw-r--r--unittest/test_pro.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/unittest/test_pro.py b/unittest/test_pro.py
index ab30e04..d2ed48b 100644
--- a/unittest/test_pro.py
+++ b/unittest/test_pro.py
@@ -509,12 +509,16 @@ def test_get_serial_number(C):
print(('Serial number of the device: ', sn))
-@pytest.mark.parametrize("secret", ['000001', '00'*10+'ff', '00'*19+'ff', '000102', '002EF43F51AFA97BA2B46418768123C9E1809A5B' ])
+@pytest.mark.parametrize("secret", ['000001', '00'*10+'ff', '00'*19+'ff', '000102',
+ '00'*29+'ff', '00'*39+'ff', '002EF43F51AFA97BA2B46418768123C9E1809A5B' ])
def test_OTP_secret_started_from_null(C, secret):
- '''
+ """
NK Pro 0.8+, NK Storage 0.43+
- '''
+ """
skip_if_device_version_lower_than({'S': 43, 'P': 8})
+ if len(secret) > 40:
+ # feature: 320 bit long secret handling
+ skip_if_device_version_lower_than({'S': 44, 'P': 8})
oath = pytest.importorskip("oath")
lib_at = lambda t: oath.hotp(secret, t, format='dec6')