From 9550d13642b6ef374d3807357b2f7a26bd0cad59 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 28 Jul 2016 12:25:36 +0200 Subject: Do not authenticate on login with admin credentials Signed-off-by: Szczepan Zalega --- NK_C_API.cc | 3 +-- NK_C_API.h | 2 +- unittest/test_bindings.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/NK_C_API.cc b/NK_C_API.cc index e6151fc..81a18b5 100644 --- a/NK_C_API.cc +++ b/NK_C_API.cc @@ -68,11 +68,10 @@ extern uint8_t NK_get_last_command_status(){ return _copy; } -extern int NK_login(const char *admin_pin, const char *temporary_password, const char *device_model) { +extern int NK_login(const char *device_model) { auto m = NitrokeyManager::instance(); try { m->connect(device_model); - m->first_authenticate(admin_pin, temporary_password); NK_last_command_status = 0; } catch (CommandFailedException & commandFailedException){ diff --git a/NK_C_API.h b/NK_C_API.h index 5520099..2db6c01 100644 --- a/NK_C_API.h +++ b/NK_C_API.h @@ -10,7 +10,7 @@ extern "C" { //Make sure each function's declaration is in one line (for automatic python declaration processing) extern void NK_set_debug(bool state); -extern int NK_login(const char *admin_pin, const char *temporary_password, const char *device_model); +extern int NK_login(const char *device_model); extern int NK_logout(); extern const char * NK_status(); extern uint8_t NK_get_last_command_status(); diff --git a/unittest/test_bindings.py b/unittest/test_bindings.py index 8d6169c..5fb7e83 100644 --- a/unittest/test_bindings.py +++ b/unittest/test_bindings.py @@ -39,7 +39,7 @@ def C(request): C = ffi.dlopen("../build/libnitrokey.so") C.NK_set_debug(False) - C.NK_login(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP, 'P') + C.NK_login('P') assert C.NK_user_authenticate(DefaultPasswords.USER, DefaultPasswords.USER_TEMP) == DeviceErrorCode.STATUS_OK # C.NK_status() -- cgit v1.2.3