From 37d833828746b2437479123866d5c54ae78e2b14 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Wed, 27 Jul 2016 06:40:31 +0200 Subject: Remove auth from getPWSslotName does not need auth. Passing tests. Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 6 ------ unittest/test_bindings.py | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 2d63c21..4446d38 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -250,12 +250,6 @@ namespace nitrokey{ assert (is_valid_password_safe_slot_number(slot_number)); auto p = get_payload(); p.slot_number = slot_number; - - auto auth = get_payload(); - strcpyT(auth.temporary_password, temporary_password); - auth.crc_to_authorize = GetPasswordSafeSlotName::CommandTransaction::getCRC(p); - UserAuthorize::CommandTransaction::run(*device, auth); - auto response = GetPasswordSafeSlotName::CommandTransaction::run(*device, p); return strdup((const char *) response.slot_name); } diff --git a/unittest/test_bindings.py b/unittest/test_bindings.py index 4bd7bb0..7632a5f 100644 --- a/unittest/test_bindings.py +++ b/unittest/test_bindings.py @@ -65,8 +65,10 @@ def test_write_password_safe_slot(C): def test_get_password_safe_slot_name(C): + assert C.NK_enable_password_safe(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK + assert C.NK_write_password_safe_slot(0, 'slotname1', 'login1', 'pass1') == DeviceErrorCode.STATUS_OK assert C.NK_lock_device() == DeviceErrorCode.STATUS_OK - assert gs(C.NK_get_password_safe_slot_name(0, DefaultPasswords.ADMIN_TEMP)) == '' + assert gs(C.NK_get_password_safe_slot_name(0, DefaultPasswords.USER_TEMP)) == '' assert C.NK_get_last_command_status() == DeviceErrorCode.STATUS_NOT_AUTHORIZED assert C.NK_enable_password_safe(DefaultPasswords.USER) == DeviceErrorCode.STATUS_OK -- cgit v1.2.1