From db76ae5299f3650385f66e4c596b18fd54250d38 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 3 Feb 2017 17:23:44 +0100 Subject: Allow users to lock encrypted volumes specifically Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 8 ++++++++ include/NitrokeyManager.h | 2 ++ include/stick20_commands.h | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 65b3c68..74a6ecf 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -766,4 +766,12 @@ namespace nitrokey{ return get_OTP_slot_data(get_internal_slot_number_for_hotp(slot_number)); } + void NitrokeyManager::lock_encrypted_volume() { + misc::execute_password_command(device, ""); + } + + void NitrokeyManager::lock_hidden_volume() { + misc::execute_password_command(device, ""); + } + } diff --git a/include/NitrokeyManager.h b/include/NitrokeyManager.h index 4a98e94..b89db63 100644 --- a/include/NitrokeyManager.h +++ b/include/NitrokeyManager.h @@ -91,8 +91,10 @@ namespace nitrokey { bool is_AES_supported(const char *user_password); void unlock_encrypted_volume(const char *user_password); + void lock_encrypted_volume(); void unlock_hidden_volume(const char *hidden_volume_password); + void lock_hidden_volume(); void set_unencrypted_read_only(const char *user_pin); diff --git a/include/stick20_commands.h b/include/stick20_commands.h index a3f1609..b887636 100644 --- a/include/stick20_commands.h +++ b/include/stick20_commands.h @@ -26,9 +26,12 @@ namespace nitrokey { public PasswordCommand {}; class EnableEncryptedPartition : public PasswordCommand {}; - class DisableEncryptedPartition : public PasswordCommand {}; class EnableHiddenEncryptedPartition : public PasswordCommand {}; + + //FIXME the volume disabling commands do not need password + class DisableEncryptedPartition : public PasswordCommand {}; class DisableHiddenEncryptedPartition : public PasswordCommand {}; + class EnableFirmwareUpdate : public PasswordCommand {}; class ChangeUpdatePassword : Command { -- cgit v1.2.1