VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/CommandLineInterface.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-19 18:18:23 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-19 18:41:41 +0100
commit07156b6c09165cf61a6bd499d26151d1f32bf3a9 (patch)
tree165e39c03eaff470c42ef8e3af8f2c3de03b6465 /src/Main/CommandLineInterface.cpp
parent18dc75ee629c5f7af61bf8393dbb693cdd78b235 (diff)
downloadVeraCrypt-07156b6c09165cf61a6bd499d26151d1f32bf3a9.tar.gz
VeraCrypt-07156b6c09165cf61a6bd499d26151d1f32bf3a9.zip
Linux/MacOSX: Enhance performance by implementing the possibility to choose the correct hash algorithm of volumes during various operations (mount, change password...), both using the GUI and the command line.
Diffstat (limited to 'src/Main/CommandLineInterface.cpp')
-rw-r--r--src/Main/CommandLineInterface.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Main/CommandLineInterface.cpp b/src/Main/CommandLineInterface.cpp
index eed8cf22..68e644b5 100644
--- a/src/Main/CommandLineInterface.cpp
+++ b/src/Main/CommandLineInterface.cpp
@@ -36,6 +36,7 @@ namespace VeraCrypt
parser.AddSwitch (L"C", L"change", _("Change password or keyfiles"));
parser.AddSwitch (L"c", L"create", _("Create new volume"));
parser.AddSwitch (L"", L"create-keyfile", _("Create new keyfile"));
+ parser.AddOption (L"", L"current-hash", _("Current hash algorithm for change password/keyfiles operation"));
parser.AddSwitch (L"", L"delete-token-keyfiles", _("Delete security token keyfiles"));
parser.AddSwitch (L"d", L"dismount", _("Dismount volume"));
parser.AddSwitch (L"", L"display-password", _("Display password while typing"));
@@ -61,6 +62,7 @@ namespace VeraCrypt
parser.AddSwitch (L"", L"non-interactive", _("Do not interact with user"));
parser.AddOption (L"p", L"password", _("Password"));
parser.AddOption (L"", L"protect-hidden", _("Protect hidden volume"));
+ parser.AddOption (L"", L"protection-hash", _("Hash algorithm for protected hidden volume"));
parser.AddOption (L"", L"protection-keyfiles", _("Keyfiles for protected hidden volume"));
parser.AddOption (L"", L"protection-password", _("Password for protected hidden volume"));
parser.AddOption (L"", L"random-source", _("Use file as source of random data"));
@@ -306,6 +308,20 @@ namespace VeraCrypt
throw_err (LangString["UNKNOWN_OPTION"] + L": " + str);
}
+ if (parser.Found (L"current-hash", &str))
+ {
+ ArgCurrentHash.reset();
+
+ foreach (shared_ptr <Hash> hash, Hash::GetAvailableAlgorithms())
+ {
+ if (wxString (hash->GetName()).IsSameAs (str, false))
+ ArgCurrentHash = hash;
+ }
+
+ if (!ArgCurrentHash)
+ throw_err (LangString["UNKNOWN_OPTION"] + L": " + str);
+ }
+
if (parser.Found (L"keyfiles", &str))
ArgKeyfiles = ToKeyfileList (str);
@@ -377,6 +393,22 @@ namespace VeraCrypt
ArgMountOptions.Protection = VolumeProtection::HiddenVolumeReadOnly;
}
+ if (parser.Found (L"protection-hash", &str))
+ {
+ bool bHashFound = false;
+ foreach (shared_ptr <Hash> hash, Hash::GetAvailableAlgorithms())
+ {
+ if (wxString (hash->GetName()).IsSameAs (str, false))
+ {
+ bHashFound = true;
+ ArgMountOptions.ProtectionKdf = Pkcs5Kdf::GetAlgorithm (*hash);
+ }
+ }
+
+ if (!bHashFound)
+ throw_err (LangString["UNKNOWN_OPTION"] + L": " + str);
+ }
+
ArgQuick = parser.Found (L"quick");
if (parser.Found (L"random-source", &str))