aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2019-03-18 20:15:58 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2019-03-19 08:18:51 +0100
commitee79dfdaf06a865cb4c5e26daac1280c9ca09905 (patch)
treee9efbc4a60a81bf7bfbe461691a916f9eccb6704
parent59a81e5bc293959f75d977ded0ba091e985c3926 (diff)
downloadlibnitrokey-ee79dfdaf06a865cb4c5e26daac1280c9ca09905.tar.gz
libnitrokey-ee79dfdaf06a865cb4c5e26daac1280c9ca09905.tar.bz2
Unlock 64 bit tests for Storage
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--unittest/misc.py6
-rw-r--r--unittest/test_pro.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/unittest/misc.py b/unittest/misc.py
index 8be915d..c1c197b 100644
--- a/unittest/misc.py
+++ b/unittest/misc.py
@@ -67,4 +67,8 @@ def is_storage(C):
def is_long_OTP_secret_handled(C):
- return is_pro_rtm_08(C) or is_storage(C) and get_devices_firmware_version(C) > 43
+ return is_pro_rtm_08(C) or is_storage(C) and get_devices_firmware_version(C) >= 54
+
+
+def has_binary_counter(C):
+ return is_pro_rtm_07(C) or is_storage(C) and get_devices_firmware_version(C) >= 54
diff --git a/unittest/test_pro.py b/unittest/test_pro.py
index 7d3dc69..d094dec 100644
--- a/unittest/test_pro.py
+++ b/unittest/test_pro.py
@@ -23,7 +23,7 @@ import pytest
from conftest import skip_if_device_version_lower_than
from constants import DefaultPasswords, DeviceErrorCode, RFC_SECRET, bb, bbRFC_SECRET
-from misc import ffi, gs, wait, cast_pointer_to_tuple
+from misc import ffi, gs, wait, cast_pointer_to_tuple, has_binary_counter
from misc import is_pro_rtm_07, is_pro_rtm_08, is_storage
@pytest.mark.lock_device
@@ -409,7 +409,7 @@ def test_HOTP_counters(C):
INT32_MAX = 2 ** 31 - 1
@pytest.mark.otp
def test_HOTP_64bit_counter(C):
- if is_storage(C):
+ if not has_binary_counter(C):
pytest.xfail('bug in NK Storage HOTP firmware - counter is set with a 8 digits string, '
'however int32max takes 10 digits to be written')
oath = pytest.importorskip("oath")
@@ -434,7 +434,7 @@ def test_HOTP_64bit_counter(C):
@pytest.mark.otp
def test_TOTP_64bit_time(C):
- if is_storage(C):
+ if not has_binary_counter(C):
pytest.xfail('bug in NK Storage TOTP firmware')
oath = pytest.importorskip("oath")
T = 1