VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount/Mount.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-01-10 05:25:49 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-01-12 09:42:54 +0100
commite831198b3b0afbcd21cb9a4b1aef90fa8b198d69 (patch)
tree5be0a3402375068ef37ce2d5b6b084c5b01d2521 /src/Mount/Mount.c
parente3d5077939898f691dcecc965e77b81a3443b662 (diff)
downloadVeraCrypt-e831198b3b0afbcd21cb9a4b1aef90fa8b198d69.tar.gz
VeraCrypt-e831198b3b0afbcd21cb9a4b1aef90fa8b198d69.zip
Windows: Fix Streebog not recognized by /hash command line switch but making hash names matching more generic.
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r--src/Mount/Mount.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 28a43acf..e90a0571 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -8836,20 +8836,22 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
if (HAS_ARGUMENT == GetArgumentValue (lpszCommandLineArgs,
&i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp)))
{
- if (_wcsicmp(szTmp, L"sha512") == 0 || _wcsicmp(szTmp, L"sha-512") == 0)
+ /* match against special names first */
+ if (_wcsicmp(szTmp, L"sha512") == 0)
CmdVolumePkcs5 = SHA512;
- else if (_wcsicmp(szTmp, L"whirlpool") == 0)
- CmdVolumePkcs5 = WHIRLPOOL;
- else if (_wcsicmp(szTmp, L"sha256") == 0 || _wcsicmp(szTmp, L"sha-256") == 0)
+ else if (_wcsicmp(szTmp, L"sha256") == 0)
CmdVolumePkcs5 = SHA256;
- else if (_wcsicmp(szTmp, L"ripemd160") == 0 || _wcsicmp(szTmp, L"ripemd-160") == 0)
+ else if (_wcsicmp(szTmp, L"ripemd160") == 0)
CmdVolumePkcs5 = RIPEMD160;
else
{
- CmdVolumePkcs5 = 0;
- AbortProcess ("COMMAND_LINE_ERROR");
+ /* match using internal hash names */
+ CmdVolumePkcs5 = HashGetIdByName (szTmp);
+ if (0 == CmdVolumePkcs5)
+ {
+ AbortProcess ("COMMAND_LINE_ERROR");
+ }
}
-
}
else
AbortProcess ("COMMAND_LINE_ERROR");