diff options
-rw-r--r-- | NitrokeyManager.cc | 11 | ||||
-rw-r--r-- | include/NitrokeyManager.h | 6 | ||||
-rw-r--r-- | include/log.h | 2 |
3 files changed, 15 insertions, 4 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){ diff --git a/include/NitrokeyManager.h b/include/NitrokeyManager.h index 7cf55c7..d49941e 100644 --- a/include/NitrokeyManager.h +++ b/include/NitrokeyManager.h @@ -122,12 +122,14 @@ namespace nitrokey { std::pair<uint8_t,uint8_t> get_SD_usage_data(); - int get_progress_bar_value(); + int get_progress_bar_value(); ~NitrokeyManager(); bool is_authorization_command_supported(); + bool is_320_OTP_secret_supported(); - template <typename S, typename A, typename T> + + template <typename S, typename A, typename T> void authorize_packet(T &package, const char *admin_temporary_password, shared_ptr<Device> device); int get_minor_firmware_version(); diff --git a/include/log.h b/include/log.h index 0b0df8c..30fc7fa 100644 --- a/include/log.h +++ b/include/log.h @@ -5,7 +5,7 @@ namespace nitrokey { namespace log { - + #ifdef ERROR #undef ERROR #endif |