diff options
-rw-r--r-- | include/stick10_commands.h | 2 | ||||
-rw-r--r-- | unittest/test_bindings.py | 10 |
2 files changed, 3 insertions, 9 deletions
diff --git a/include/stick10_commands.h b/include/stick10_commands.h index 95aaa93..f7813c4 100644 --- a/include/stick10_commands.h +++ b/include/stick10_commands.h @@ -669,7 +669,7 @@ class Authorize : Command<CommandID::AUTHORIZE> { class UserAuthorize : Command<CommandID::USER_AUTHORIZE> { public: struct CommandPayload { - uint64_t crc_to_authorize; + uint32_t crc_to_authorize; uint8_t temporary_password[25]; std::string dissect() const { std::stringstream ss; 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") |