aboutsummaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index f912c7c..d563b26 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -838,7 +838,7 @@ using nitrokey::misc::strcpyT;
void NitrokeyManager::set_unencrypted_read_only_admin(const char* admin_pin) {
//from v0.49, v0.51+ it needs Admin PIN
- if (set_unencrypted_volume_rorw_pin_type_user(get_minor_firmware_version())){
+ if (set_unencrypted_volume_rorw_pin_type_user()){
LOG("set_unencrypted_read_only_admin is not supported for this version of Storage device. "
"Please update firmware to v0.51+", nitrokey::log::Loglevel::WARNING);
return;
@@ -850,7 +850,7 @@ using nitrokey::misc::strcpyT;
//until v0.48 (incl. v0.50) User PIN was sufficient
LOG("set_unencrypted_read_only is deprecated. Use set_unencrypted_read_only_admin instead.",
nitrokey::log::Loglevel::WARNING);
- if (!set_unencrypted_volume_rorw_pin_type_user(get_minor_firmware_version())){
+ if (!set_unencrypted_volume_rorw_pin_type_user()){
LOG("set_unencrypted_read_only is not supported for this version of Storage device. Doing nothing.",
nitrokey::log::Loglevel::WARNING);
return;
@@ -860,7 +860,7 @@ using nitrokey::misc::strcpyT;
void NitrokeyManager::set_unencrypted_read_write_admin(const char* admin_pin) {
//from v0.49, v0.51+ it needs Admin PIN
- if (set_unencrypted_volume_rorw_pin_type_user(get_minor_firmware_version())){
+ if (set_unencrypted_volume_rorw_pin_type_user()){
LOG("set_unencrypted_read_write_admin is not supported for this version of Storage device. "
"Please update firmware to v0.51+.", nitrokey::log::Loglevel::WARNING);
return;
@@ -872,7 +872,7 @@ using nitrokey::misc::strcpyT;
//until v0.48 (incl. v0.50) User PIN was sufficient
LOG("set_unencrypted_read_write is deprecated. Use set_unencrypted_read_write_admin instead.",
nitrokey::log::Loglevel::WARNING);
- if (!set_unencrypted_volume_rorw_pin_type_user(get_minor_firmware_version())){
+ if (!set_unencrypted_volume_rorw_pin_type_user()){
LOG("set_unencrypted_read_write is not supported for this version of Storage device. Doing nothing.",
nitrokey::log::Loglevel::WARNING);
return;
@@ -880,7 +880,8 @@ using nitrokey::misc::strcpyT;
misc::execute_password_command<stick20::SendSetReadwriteToUncryptedVolume>(device, user_pin);
}
- bool NitrokeyManager::set_unencrypted_volume_rorw_pin_type_user(const int minor_firmware_version) const {
+ bool NitrokeyManager::set_unencrypted_volume_rorw_pin_type_user(){
+ auto minor_firmware_version = get_minor_firmware_version();
return minor_firmware_version <= 48 || minor_firmware_version == 50;
}