VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/CommandLineInterface.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-04-24 20:56:42 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-04-25 22:05:22 (GMT)
commit9ccb8a97afe66516b02da88b0997cc0d944a1010 (patch)
tree6fc7da54faf4791370a29b130aee6b1037a752d4 /src/Main/CommandLineInterface.cpp
parentbf8e07966be201ad47f112c6a8e93a897bfc6c80 (diff)
downloadVeraCrypt-9ccb8a97afe66516b02da88b0997cc0d944a1010.zip
VeraCrypt-9ccb8a97afe66516b02da88b0997cc0d944a1010.tar.gz
Linux: in command line, support hash algorithm names without '-' as on Windows ("sha256", "sha512", "ripemd160")
Diffstat (limited to 'src/Main/CommandLineInterface.cpp')
-rw-r--r--src/Main/CommandLineInterface.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Main/CommandLineInterface.cpp b/src/Main/CommandLineInterface.cpp
index 82a99e7..541f66d 100644
--- a/src/Main/CommandLineInterface.cpp
+++ b/src/Main/CommandLineInterface.cpp
@@ -307,7 +307,9 @@ namespace VeraCrypt
foreach (shared_ptr <Hash> hash, Hash::GetAvailableAlgorithms())
{
- if (wxString (hash->GetName()).IsSameAs (str, false))
+ wxString hashName (hash->GetName());
+ wxString hashAltName (hash->GetAltName());
+ if (hashName.IsSameAs (str, false) || hashAltName.IsSameAs (str, false))
ArgHash = hash;
}
@@ -321,7 +323,9 @@ namespace VeraCrypt
foreach (shared_ptr <Hash> hash, Hash::GetAvailableAlgorithms())
{
- if (wxString (hash->GetName()).IsSameAs (str, false))
+ wxString hashName (hash->GetName());
+ wxString hashAltName (hash->GetAltName());
+ if (hashName.IsSameAs (str, false) || hashAltName.IsSameAs (str, false))
ArgCurrentHash = hash;
}
@@ -405,7 +409,9 @@ namespace VeraCrypt
bool bHashFound = false;
foreach (shared_ptr <Hash> hash, Hash::GetAvailableAlgorithms())
{
- if (wxString (hash->GetName()).IsSameAs (str, false))
+ wxString hashName (hash->GetName());
+ wxString hashAltName (hash->GetAltName());
+ if (hashName.IsSameAs (str, false) || hashAltName.IsSameAs (str, false))
{
bHashFound = true;
ArgMountOptions.ProtectionKdf = Pkcs5Kdf::GetAlgorithm (*hash, ArgTrueCryptMode);