From 9e1f590d5a929a21223bb39ae5123d27e69fda66 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 17 Jan 2020 18:19:45 +0100 Subject: Add tests for Pro`s bootloader --- unittest/constants.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'unittest/constants.py') diff --git a/unittest/constants.py b/unittest/constants.py index 645ef6a..bf4f5b9 100644 --- a/unittest/constants.py +++ b/unittest/constants.py @@ -39,6 +39,9 @@ class DefaultPasswords: USER_TEMP = b'234234234' UPDATE = b'12345678' UPDATE_TEMP = b'123update123' + UPDATE_LONG = b'1234567890'*2 + UPDATE_TOO_LONG = UPDATE_LONG + b'x' + UPDATE_TOO_SHORT = b'1234567' class DeviceErrorCode: -- cgit v1.2.1 From 4d6a01cd2f2ec6440f5dd2c02048cbb413f91f5d Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 27 Jan 2020 18:18:55 +0100 Subject: Correct result of successful execution for bootloader to DISCONNECTED --- unittest/constants.py | 1 + 1 file changed, 1 insertion(+) (limited to 'unittest/constants.py') diff --git a/unittest/constants.py b/unittest/constants.py index bf4f5b9..9e04701 100644 --- a/unittest/constants.py +++ b/unittest/constants.py @@ -52,6 +52,7 @@ class DeviceErrorCode: STATUS_NOT_AUTHORIZED = 5 STATUS_AES_DEC_FAILED = 0xa STATUS_UNKNOWN_ERROR = 100 + STATUS_DISCONNECTED = 255 class LibraryErrors: -- cgit v1.2.1 From fdce2aee7dacbbfaad300fd6bef6dd70c0766604 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 27 Jan 2020 18:19:24 +0100 Subject: Change too short password to default, but short of 1 letter --- unittest/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unittest/constants.py') diff --git a/unittest/constants.py b/unittest/constants.py index 9e04701..1ba52fa 100644 --- a/unittest/constants.py +++ b/unittest/constants.py @@ -41,7 +41,7 @@ class DefaultPasswords: UPDATE_TEMP = b'123update123' UPDATE_LONG = b'1234567890'*2 UPDATE_TOO_LONG = UPDATE_LONG + b'x' - UPDATE_TOO_SHORT = b'1234567' + UPDATE_TOO_SHORT = UPDATE_LONG[:7] class DeviceErrorCode: -- cgit v1.2.1 From 59ca679eeb272163e4ebbb2f01231adc4820cda1 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 28 Jan 2020 14:52:09 +0100 Subject: Refactor move --- unittest/constants.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'unittest/constants.py') diff --git a/unittest/constants.py b/unittest/constants.py index 1ba52fa..b73dfe8 100644 --- a/unittest/constants.py +++ b/unittest/constants.py @@ -21,8 +21,6 @@ SPDX-License-Identifier: LGPL-3.0 from misc import to_hex -def bb(x): - return bytes(x, encoding='ascii') RFC_SECRET_HR = '12345678901234567890' -- cgit v1.2.1 From 55f9b7293c22bbedd5a972fa8f1946dfd57d9c7a Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 25 Feb 2020 14:10:30 +0100 Subject: Data retention test. Refactoring. Helper functions. --- unittest/constants.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'unittest/constants.py') diff --git a/unittest/constants.py b/unittest/constants.py index b73dfe8..4047f59 100644 --- a/unittest/constants.py +++ b/unittest/constants.py @@ -18,10 +18,7 @@ along with libnitrokey. If not, see . SPDX-License-Identifier: LGPL-3.0 """ - -from misc import to_hex - - +from misc import to_hex, bb RFC_SECRET_HR = '12345678901234567890' RFC_SECRET = to_hex(RFC_SECRET_HR) # '31323334353637383930...' @@ -61,4 +58,5 @@ class LibraryErrors: HOTP_slot_count = 3 -TOTP_slot_count = 15 \ No newline at end of file +TOTP_slot_count = 15 +PWS_SLOT_COUNT = 16 -- cgit v1.2.1