aboutsummaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-02-21 13:12:12 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-11 15:41:49 +0100
commitad286a23ba8a542afe0095b97caf52320778c5e6 (patch)
tree9936362bd9e35017d1d68c4258fa1d064ac3cc7c /NitrokeyManager.cc
parent343b77dde196ab2e8ea82e7149b5703a771a9699 (diff)
downloadlibnitrokey-ad286a23ba8a542afe0095b97caf52320778c5e6.tar.gz
libnitrokey-ad286a23ba8a542afe0095b97caf52320778c5e6.tar.bz2
Feature check for 320 bits OTP secret
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index 2858a18..62687b3 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -650,11 +650,20 @@ namespace nitrokey{
//authorization command is supported for versions equal or below:
auto m = std::unordered_map<DeviceModel , int, EnumClassHash>({
{DeviceModel::PRO, 7},
- {DeviceModel::STORAGE, 99},
+ {DeviceModel::STORAGE, 999},
});
return get_minor_firmware_version() <= m[device->get_device_model()];
}
+ bool NitrokeyManager::is_320_OTP_secret_supported(){
+ //authorization command is supported for versions equal or below:
+ auto m = std::unordered_map<DeviceModel , int, EnumClassHash>({
+ {DeviceModel::PRO, 8},
+ {DeviceModel::STORAGE, 999},
+ });
+ return get_minor_firmware_version() >= m[device->get_device_model()];
+ }
+
DeviceModel NitrokeyManager::get_connected_device_model() const{
//FIXME throw if no device is connected or return unknown/unconnected value
if (device == nullptr){