From c5eb2fd61869d33e48d55007e6d262c2b80e01e8 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sun, 14 Apr 2019 03:17:23 +0100 Subject: md4: Move the WinCrypt implementation out of the NTLM code --- lib/curl_ntlm_core.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'lib/curl_ntlm_core.c') diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index 332d9409a..abf4ac0b5 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -110,6 +110,7 @@ # include "curl_md4.h" #elif defined(USE_WIN32_CRYPTO) # include +# include "curl_md4.h" #else # error "Can't compile NTLM support without a crypto library." #endif @@ -584,18 +585,7 @@ CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data, #elif defined(USE_OS400CRYPTO) Curl_md4it(ntbuffer, pw, 2 * len); #elif defined(USE_WIN32_CRYPTO) - HCRYPTPROV hprov; - if(CryptAcquireContext(&hprov, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT)) { - HCRYPTHASH hhash; - if(CryptCreateHash(hprov, CALG_MD4, 0, 0, &hhash)) { - DWORD length = 16; - CryptHashData(hhash, pw, (unsigned int)len * 2, 0); - CryptGetHashParam(hhash, HP_HASHVAL, ntbuffer, &length, 0); - CryptDestroyHash(hhash); - } - CryptReleaseContext(hprov, 0); - } + Curl_md4it(ntbuffer, pw, 2 * len); #endif memset(ntbuffer + 16, 0, 21 - 16); -- cgit v1.2.3