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/Format/Tcformat.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/Format/Tcformat.c')
-rw-r--r-- | src/Format/Tcformat.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index d83d9f49..02210b15 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c | |||
@@ -9000,20 +9000,22 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) | |||
9000 | if (HAS_ARGUMENT == GetArgumentValue (lpszCommandLineArgs, | 9000 | if (HAS_ARGUMENT == GetArgumentValue (lpszCommandLineArgs, |
9001 | &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp))) | 9001 | &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp))) |
9002 | { | 9002 | { |
9003 | if (_wcsicmp(szTmp, L"sha512") == 0 || _wcsicmp(szTmp, L"sha-512") == 0) | 9003 | /* match against special names first */ |
9004 | if (_wcsicmp(szTmp, L"sha512") == 0) | ||
9004 | CmdVolumePkcs5 = SHA512; | 9005 | CmdVolumePkcs5 = SHA512; |
9005 | else if (_wcsicmp(szTmp, L"whirlpool") == 0) | 9006 | else if (_wcsicmp(szTmp, L"sha256") == 0) |
9006 | CmdVolumePkcs5 = WHIRLPOOL; | ||
9007 | else if (_wcsicmp(szTmp, L"sha256") == 0 || _wcsicmp(szTmp, L"sha-256") == 0) | ||
9008 | CmdVolumePkcs5 = SHA256; | 9007 | CmdVolumePkcs5 = SHA256; |
9009 | else if (_wcsicmp(szTmp, L"ripemd160") == 0 || _wcsicmp(szTmp, L"ripemd-160") == 0) | 9008 | else if (_wcsicmp(szTmp, L"ripemd160") == 0) |
9010 | CmdVolumePkcs5 = RIPEMD160; | 9009 | CmdVolumePkcs5 = RIPEMD160; |
9011 | else | 9010 | else |
9012 | { | 9011 | { |
9013 | CmdVolumePkcs5 = 0; | 9012 | /* match using internal hash names */ |
9014 | AbortProcess ("COMMAND_LINE_ERROR"); | 9013 | CmdVolumePkcs5 = HashGetIdByName (szTmp); |
9014 | if (0 == CmdVolumePkcs5) | ||
9015 | { | ||
9016 | AbortProcess ("COMMAND_LINE_ERROR"); | ||
9017 | } | ||
9015 | } | 9018 | } |
9016 | |||
9017 | } | 9019 | } |
9018 | else | 9020 | else |
9019 | AbortProcess ("COMMAND_LINE_ERROR"); | 9021 | AbortProcess ("COMMAND_LINE_ERROR"); |