summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-12-12 15:36:55 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2016-12-12 15:36:55 +0100
commit9c627a75f027e2a6a9518869dc48fba28904ba49 (patch)
tree1b1139251082118c44cdb92174d6d62f077309e3
parent58c15291c3c758bc79adc8e65d471b1f5dded136 (diff)
downloadlibnitrokey-9c627a75f027e2a6a9518869dc48fba28904ba49.tar.gz
libnitrokey-9c627a75f027e2a6a9518869dc48fba28904ba49.tar.bz2
Use proper firmware version getter for feature availability check
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--NitrokeyManager.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index a15b9c8..ddec600 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -589,13 +589,12 @@ namespace nitrokey{
}
bool NitrokeyManager::is_authorization_command_supported(){
+ //authorization command is supported for versions equal or below:
auto m = std::unordered_map<DeviceModel , int, EnumClassHash>({
{DeviceModel::PRO, 7},
{DeviceModel::STORAGE, 43},
});
- auto status_p = GetStatus::CommandTransaction::run(*device);
- //FIXME use different function for checking storage firmware version
- return status_p.data().firmware_version <= m[device->get_device_model()];
+ return get_major_firmware_version() <= m[device->get_device_model()];
}
int NitrokeyManager::get_major_firmware_version(){