diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-01-10 05:25:49 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-01-12 09:42:54 +0100 |
commit | e831198b3b0afbcd21cb9a4b1aef90fa8b198d69 (patch) | |
tree | 5be0a3402375068ef37ce2d5b6b084c5b01d2521 /src/Mount/Mount.c | |
parent | e3d5077939898f691dcecc965e77b81a3443b662 (diff) | |
download | VeraCrypt-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.c | 18 |
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) | |||
8836 | if (HAS_ARGUMENT == GetArgumentValue (lpszCommandLineArgs, | 8836 | if (HAS_ARGUMENT == GetArgumentValue (lpszCommandLineArgs, |
8837 | &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp))) | 8837 | &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp))) |
8838 | { | 8838 | { |
8839 | if (_wcsicmp(szTmp, L"sha512") == 0 || _wcsicmp(szTmp, L"sha-512") == 0) | 8839 | /* match against special names first */ |
8840 | if (_wcsicmp(szTmp, L"sha512") == 0) | ||
8840 | CmdVolumePkcs5 = SHA512; | 8841 | CmdVolumePkcs5 = SHA512; |
8841 | else if (_wcsicmp(szTmp, L"whirlpool") == 0) | 8842 | else if (_wcsicmp(szTmp, L"sha256") == 0) |
8842 | CmdVolumePkcs5 = WHIRLPOOL; | ||
8843 | else if (_wcsicmp(szTmp, L"sha256") == 0 || _wcsicmp(szTmp, L"sha-256") == 0) | ||
8844 | CmdVolumePkcs5 = SHA256; | 8843 | CmdVolumePkcs5 = SHA256; |
8845 | else if (_wcsicmp(szTmp, L"ripemd160") == 0 || _wcsicmp(szTmp, L"ripemd-160") == 0) | 8844 | else if (_wcsicmp(szTmp, L"ripemd160") == 0) |
8846 | CmdVolumePkcs5 = RIPEMD160; | 8845 | CmdVolumePkcs5 = RIPEMD160; |
8847 | else | 8846 | else |
8848 | { | 8847 | { |
8849 | CmdVolumePkcs5 = 0; | 8848 | /* match using internal hash names */ |
8850 | AbortProcess ("COMMAND_LINE_ERROR"); | 8849 | CmdVolumePkcs5 = HashGetIdByName (szTmp); |
8850 | if (0 == CmdVolumePkcs5) | ||
8851 | { | ||
8852 | AbortProcess ("COMMAND_LINE_ERROR"); | ||
8853 | } | ||
8851 | } | 8854 | } |
8852 | |||
8853 | } | 8855 | } |
8854 | else | 8856 | else |
8855 | AbortProcess ("COMMAND_LINE_ERROR"); | 8857 | AbortProcess ("COMMAND_LINE_ERROR"); |