aboutsummaryrefslogtreecommitdiff
path: root/unittest/misc.py
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-03-02 11:41:13 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-03-02 11:41:13 +0100
commit379daf936caa7fc8d7311a5dda101edb40d35ca5 (patch)
tree2d186dec6976b12a9f7b37e589c02703275a30ef /unittest/misc.py
parentd5486ba77235a874245fbee07a75cea89fa59ea2 (diff)
parentc3d615b659b608f3a1d624f6fc78c303efbe1f8e (diff)
downloadlibnitrokey-379daf936caa7fc8d7311a5dda101edb40d35ca5.tar.gz
libnitrokey-379daf936caa7fc8d7311a5dda101edb40d35ca5.tar.bz2
Merge branch 'wip-multiple_devices'
Allow to use multiple devices, iteratively. Storage only.
Diffstat (limited to 'unittest/misc.py')
-rw-r--r--unittest/misc.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/unittest/misc.py b/unittest/misc.py
index a41f2b2..8be915d 100644
--- a/unittest/misc.py
+++ b/unittest/misc.py
@@ -43,7 +43,7 @@ def cast_pointer_to_tuple(obj, typen, len):
def get_devices_firmware_version(C):
- firmware = C.NK_get_major_firmware_version()
+ firmware = C.NK_get_minor_firmware_version()
return firmware
@@ -54,7 +54,7 @@ def is_pro_rtm_07(C):
def is_pro_rtm_08(C):
firmware = get_devices_firmware_version(C)
- return firmware == 8
+ return firmware in [8,9]
def is_storage(C):
@@ -62,7 +62,8 @@ def is_storage(C):
exact firmware storage is sent by other function
"""
# TODO identify connected device directly
- return not is_pro_rtm_08(C) and not is_pro_rtm_07(C)
+ firmware = get_devices_firmware_version(C)
+ return firmware >= 45
def is_long_OTP_secret_handled(C):