summaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-08-05 11:06:49 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-05 11:34:18 +0200
commit0688078d9c8ec564a72e8101c3859f3226f65289 (patch)
tree6712d14c8310056f4c20f90df190ea9d8778c8de /unittest
parent42446e1a384d3391e4240afe349c34958e5fabed (diff)
downloadlibnitrokey-0688078d9c8ec564a72e8101c3859f3226f65289.tar.gz
libnitrokey-0688078d9c8ec564a72e8101c3859f3226f65289.tar.bz2
Fixed PIN protected HOTP requests
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r--unittest/test_bindings.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/unittest/test_bindings.py b/unittest/test_bindings.py
index 7093eda..fc406b4 100644
--- a/unittest/test_bindings.py
+++ b/unittest/test_bindings.py
@@ -242,18 +242,12 @@ def check_RFC_codes(C, func, prep=None):
assert code == r
-@pytest.mark.skip(reason="not working correctly, skipping for now")
def test_HOTP_RFC_pin_protection(C):
C.NK_set_debug(True)
assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
assert C.NK_write_config(True, True, True, True, False, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
- assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
- assert C.NK_write_hotp_slot(1, 'python_test', RFC_SECRET, 0, False, False, False, "",
- DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
- # check_RFC_codes(C, lambda x: C.NK_get_hotp_code_PIN(x, DefaultPasswords.USER_TEMP), lambda: C.NK_user_authenticate(DefaultPasswords.USER, DefaultPasswords.USER_TEMP))
- assert C.NK_user_authenticate(DefaultPasswords.USER, DefaultPasswords.USER_TEMP) == DeviceErrorCode.STATUS_OK
- assert C.NK_get_hotp_code_PIN(1, DefaultPasswords.USER_TEMP) == 755224
- assert C.NK_get_last_command_status() == DeviceErrorCode.STATUS_OK
+ check_RFC_codes(C, lambda x: C.NK_get_hotp_code_PIN(x, DefaultPasswords.USER_TEMP),
+ lambda: C.NK_user_authenticate(DefaultPasswords.USER, DefaultPasswords.USER_TEMP))
@pytest.mark.skip(reason="not implemented yet")