From e831198b3b0afbcd21cb9a4b1aef90fa8b198d69 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 10 Jan 2017 05:25:49 +0100 Subject: Windows: Fix Streebog not recognized by /hash command line switch but making hash names matching more generic. --- src/Common/Crypto.c | 5 +++-- src/Common/Crypto.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Common') diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c index 808c8af7..6c2b2e84 100644 --- a/src/Common/Crypto.c +++ b/src/Common/Crypto.c @@ -762,16 +762,17 @@ Hash *HashGet (int id) return 0; } - +#ifdef _WIN32 int HashGetIdByName (wchar_t *name) { int i; for (i = 0; Hashes[i].Id != 0; i++) - if (wcscmp (Hashes[i].Name, name) == 0) + if (_wcsicmp (Hashes[i].Name, name) == 0) return Hashes[i].Id; return 0; } +#endif const wchar_t *HashGetName (int hashId) { diff --git a/src/Common/Crypto.h b/src/Common/Crypto.h index 8e8bace7..9aba0eae 100644 --- a/src/Common/Crypto.h +++ b/src/Common/Crypto.h @@ -363,7 +363,9 @@ BOOL EAIsModeSupported (int ea, int testedMode); #ifndef TC_WINDOWS_BOOT const wchar_t *HashGetName (int hash_algo_id); - +#ifdef _WIN32 +int HashGetIdByName (wchar_t *name); +#endif Hash *HashGet (int id); void HashGetName2 (wchar_t *buf, int hashId); BOOL HashIsDeprecated (int hashId); -- cgit v1.2.3