From eb88d778e751639d68d932b23a648e591bcc0ba8 Mon Sep 17 00:00:00 2001 From: Bill Nagel Date: Tue, 2 Dec 2014 13:21:52 -0500 Subject: ntlm: Use Windows Crypt API Allow the use of the Windows Crypt API for NTLMv1 functions. --- lib/curl_ntlm_core.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'lib/curl_ntlm_core.h') diff --git a/lib/curl_ntlm_core.h b/lib/curl_ntlm_core.h index 0a6dd934c..5e89ef056 100644 --- a/lib/curl_ntlm_core.h +++ b/lib/curl_ntlm_core.h @@ -24,7 +24,7 @@ #include "curl_setup.h" -#if defined(USE_NTLM) && !defined(USE_WINDOWS_SSPI) +#if defined(USE_NTLM) #ifdef USE_SSLEAY # if !defined(OPENSSL_VERSION_NUMBER) && \ @@ -46,7 +46,9 @@ #ifndef USE_NTRESPONSES # define USE_NTRESPONSES 1 -# define USE_NTLM2SESSION 1 +# ifndef USE_WIN32_CRYPTO +# define USE_NTLM2SESSION 1 +# endif #endif void Curl_ntlm_core_lm_resp(const unsigned char *keys, @@ -58,14 +60,16 @@ CURLcode Curl_ntlm_core_mk_lm_hash(struct SessionHandle *data, unsigned char *lmbuffer /* 21 bytes */); #if USE_NTRESPONSES -CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen, - const unsigned char *data, unsigned int datalen, - unsigned char *output); - CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data, const char *password, unsigned char *ntbuffer /* 21 bytes */); +#ifndef USE_WINDOWS_SSPI + +CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen, + const unsigned char *data, unsigned int datalen, + unsigned char *output); + CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen, const char *domain, size_t domlen, unsigned char *ntlmhash, @@ -82,8 +86,10 @@ CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash, unsigned char *challenge_server, unsigned char *lmresp); -#endif +#endif /* !USE_WINDOWS_SSPI */ + +#endif /* USE_NTRESPONSES */ -#endif /* USE_NTLM && !USE_WINDOWS_SSPI */ +#endif /* USE_NTLM */ #endif /* HEADER_CURL_NTLM_CORE_H */ -- cgit v1.2.3