aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_ntlm_core.h
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-12-12 21:57:59 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-12-12 22:34:16 +0000
commit82fdb87b275db7bbff512e04ed7cf199aa1da8d8 (patch)
tree3cf80892a226943c715c201fbbaef7e901bc1d37 /lib/curl_ntlm_core.h
parent97e90d7b8928f49c00ff8109a371e0613821fbc1 (diff)
downloadgnurl-82fdb87b275db7bbff512e04ed7cf199aa1da8d8.tar.gz
gnurl-82fdb87b275db7bbff512e04ed7cf199aa1da8d8.tar.bz2
gnurl-82fdb87b275db7bbff512e04ed7cf199aa1da8d8.zip
ntlm: Disable NTLM v2 when 64-bit integers are not supported
This fixes compilation issues with compilers that don't support 64-bit integers through long long or __int64 which was introduced in commit 07b66cbfa4.
Diffstat (limited to 'lib/curl_ntlm_core.h')
-rw-r--r--lib/curl_ntlm_core.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/curl_ntlm_core.h b/lib/curl_ntlm_core.h
index c9dde7e4c..c1689666c 100644
--- a/lib/curl_ntlm_core.h
+++ b/lib/curl_ntlm_core.h
@@ -36,6 +36,7 @@
# ifdef OPENSSL_NO_MD4
# define USE_NTRESPONSES 0
# define USE_NTLM2SESSION 0
+# define USE_NTLM_V2 0
# endif
#endif
@@ -52,6 +53,13 @@
#define USE_NTLM2SESSION 1
#endif
+/* Define USE_NTLM_V2 to 1 in order to allow the type-3 message to include the
+ LMv2 and NTLMv2 response messages, requires USE_NTRESPONSES defined to 1
+ and support for 64-bit integers. */
+#if !defined(USE_NTLM_V2) && USE_NTRESPONSES && (CURL_SIZEOF_CURL_OFF_T > 4)
+#define USE_NTLM_V2 1
+#endif
+
void Curl_ntlm_core_lm_resp(const unsigned char *keys,
const unsigned char *plaintext,
unsigned char *results);
@@ -65,7 +73,7 @@ CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data,
const char *password,
unsigned char *ntbuffer /* 21 bytes */);
-#ifndef USE_WINDOWS_SSPI
+#if USE_NTLM_V2 && !defined(USE_WINDOWS_SSPI)
CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen,
const unsigned char *data, unsigned int datalen,
@@ -87,7 +95,7 @@ CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash,
unsigned char *challenge_server,
unsigned char *lmresp);
-#endif /* !USE_WINDOWS_SSPI */
+#endif /* USE_NTLM_V2 && !USE_WINDOWS_SSPI */
#endif /* USE_NTRESPONSES */