summaryrefslogtreecommitdiff
path: root/unittest/test_library.py
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-12-06 20:00:42 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2016-12-09 08:46:57 +0100
commit279a310d6710908943237f5528d64a94ecd45885 (patch)
tree9ca4853dd4e108c5ffa68afdfbc5ac93c91493bd /unittest/test_library.py
parent740b85c7f935029003e205dcbb5d49842eac1ad6 (diff)
downloadlibnitrokey-279a310d6710908943237f5528d64a94ecd45885.tar.gz
libnitrokey-279a310d6710908943237f5528d64a94ecd45885.tar.bz2
Tests: check are long OTP secrets supported
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest/test_library.py')
-rw-r--r--unittest/test_library.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/unittest/test_library.py b/unittest/test_library.py
index d0eef80..7b05c58 100644
--- a/unittest/test_library.py
+++ b/unittest/test_library.py
@@ -1,6 +1,6 @@
import pytest
-from misc import ffi, gs, to_hex
+from misc import ffi, gs, to_hex, is_pro_rtm_07, is_long_OTP_secret_handled
from constants import DefaultPasswords, DeviceErrorCode, RFC_SECRET, LibraryErrors
def test_too_long_strings(C):
@@ -50,6 +50,8 @@ def test_invalid_secret_hex_string_for_OTP_write(C, invalid_hex_string):
def test_warning_binary_bigger_than_secret_buffer(C):
invalid_hex_string = to_hex('1234567890') * 3
+ if is_long_OTP_secret_handled(C):
+ invalid_hex_string *= 2
assert C.NK_write_hotp_slot(1, 'slot_name', invalid_hex_string, 0, True, False, False, '',
DefaultPasswords.ADMIN_TEMP) == LibraryErrors.TARGET_BUFFER_SIZE_SMALLER_THAN_SOURCE