1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Linux: in command line, support hash algorithm names without '-' as on Windows ("sha256", "sha512", "ripemd160")

This commit is contained in:
Mounir IDRASSI
2015-04-24 22:56:42 +02:00
parent bf8e07966b
commit 9ccb8a97af
2 changed files with 14 additions and 3 deletions

View File

@@ -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);