From 0cf995e79221fa2e88801fb910eba8aacf54d58a Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 25 Jun 2019 09:21:16 +0200 Subject: Add numbers to generated OTP slot names Signed-off-by: Szczepan Zalega --- unittest/test_pro.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/unittest/test_pro.py b/unittest/test_pro.py index 5162365..a8df7cd 100644 --- a/unittest/test_pro.py +++ b/unittest/test_pro.py @@ -434,7 +434,8 @@ def test_HOTP_64bit_counter(C): def helper_set_HOTP_test_slot(C, slot_number): assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK - assert C.NK_write_hotp_slot(slot_number, b'python_test', bbRFC_SECRET, 0, False, False, True, b'', DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK + slot_name = b'HOTP_test'[:-2] + '{:02}'.format(slot_number).encode() + assert C.NK_write_hotp_slot(slot_number, slot_name, bbRFC_SECRET, 0, False, False, True, b'', DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK def helper_set_TOTP_test_slot(C, slot_number): @@ -443,7 +444,8 @@ def helper_set_TOTP_test_slot(C, slot_number): assert C.NK_write_config(255, 255, 255, PIN_protection, not PIN_protection, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK assert C.NK_first_authenticate(DefaultPasswords.ADMIN, DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK - assert C.NK_write_totp_slot(slot_number, b'python_test', bbRFC_SECRET, 30, False, False, False, b'', + slot_name = b'TOTP_test'[:-2] + '{:02}'.format(slot_number).encode() + assert C.NK_write_totp_slot(slot_number, slot_name, bbRFC_SECRET, 30, False, False, False, b'', DefaultPasswords.ADMIN_TEMP) == DeviceErrorCode.STATUS_OK -- cgit v1.2.3