summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-07-27 10:34:07 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-01 13:54:57 +0200
commit1edde0fe0dfa5e06f38fbcf5a3969b2da9d065ea (patch)
treec3df659ed4b020f989a9eaecd0c45a524bfed39d
parent8c5b24092faf90672523e60e6eee12a83539ce11 (diff)
downloadlibnitrokey-1edde0fe0dfa5e06f38fbcf5a3969b2da9d065ea.tar.gz
libnitrokey-1edde0fe0dfa5e06f38fbcf5a3969b2da9d065ea.tar.bz2
Add authentication for erasing slots
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--unittest/test_bindings.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/unittest/test_bindings.py b/unittest/test_bindings.py
index e94a6d6..da3bc83 100644
--- a/unittest/test_bindings.py
+++ b/unittest/test_bindings.py
@@ -183,8 +183,10 @@ def test_get_slot_names(C):
def test_get_OTP_codes(C):
C.NK_set_debug(True)
- # assert C.NK_erase_hotp_slot(0, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
- # assert C.NK_erase_totp_slot(0, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
+ assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
+ assert C.NK_erase_hotp_slot(0, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
+ assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
+ assert C.NK_erase_totp_slot(0, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK
for i in range(16):
code = C.NK_get_totp_code(i, 0, 0, 0)
if code == 0: