diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-02-21 13:12:12 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-03-11 15:41:49 +0100 |
commit | ad286a23ba8a542afe0095b97caf52320778c5e6 (patch) | |
tree | 9936362bd9e35017d1d68c4258fa1d064ac3cc7c /NitrokeyManager.cc | |
parent | 343b77dde196ab2e8ea82e7149b5703a771a9699 (diff) | |
download | libnitrokey-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.cc | 11 |
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){ |