]> granicus.if.org Git - curl/commitdiff
ntlm: Allow NTLM2Session messages when USE_NTRESPONSES manually defined
authorSteve Holme <steve_holme@hotmail.com>
Fri, 12 Dec 2014 21:40:09 +0000 (21:40 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Fri, 12 Dec 2014 22:33:57 +0000 (22:33 +0000)
Previously USE_NTLM2SESSION would only be defined automatically when
USE_NTRESPONSES wasn't already defined. Separated the two definitions
so that the user can manually set USE_NTRESPONSES themselves but
USE_NTLM2SESSION is defined automatically if they don't define it.

lib/curl_ntlm_core.h
lib/curl_ntlm_msgs.c

index a600f0a7fc804fa7c747dfb455bf674b53806015..c9dde7e4c3f3777e46186f636e6c2f2fd9c3b6ef 100644 (file)
 #  endif
 #endif
 
-/*
- * Define USE_NTRESPONSES to 1 in order to make the type-3 message include
- * the NT response message. Define USE_NTLM2SESSION to 1 in order to make
- * the type-3 message include the NTLM2Session response message, requires
- * USE_NTRESPONSES defined to 1.
- */
-
+/* Define USE_NTRESPONSES to 1 in order to make the type-3 message include
+ * the NT response message. */
 #ifndef USE_NTRESPONSES
-#  define USE_NTRESPONSES 1
-#  ifndef USE_WIN32_CRYPTO
-#    define USE_NTLM2SESSION 1
-#  endif
+#define USE_NTRESPONSES 1
+#endif
+
+/* Define USE_NTLM2SESSION to 1 in order to make the type-3 message include the
+   NTLM2Session response message, requires USE_NTRESPONSES defined to 1 and a
+   Crypto engine that we have curl_ssl_md5sum() for. */
+#if !defined(USE_NTLM2SESSION) && USE_NTRESPONSES && !defined(USE_WIN32_CRYPTO)
+#define USE_NTLM2SESSION 1
 #endif
 
 void Curl_ntlm_core_lm_resp(const unsigned char *keys,
index 1abcc8533588962bc13818679307217b47af3dd9..b31952138b434aa1be31af6d093ad3334d3c975a 100644 (file)
@@ -396,7 +396,7 @@ CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp,
   /* Clean up any former leftovers and initialise to defaults */
   Curl_sasl_ntlm_cleanup(ntlm);
 
-#if USE_NTLM2SESSION
+#if USE_NTRESPONSES && USE_NTLM2SESSION
 #define NTLM2FLAG NTLMFLAG_NEGOTIATE_NTLM2_KEY
 #else
 #define NTLM2FLAG 0
@@ -591,7 +591,7 @@ CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data,
   else
 #endif
 
-#if USE_NTLM2SESSION
+#if USE_NTRESPONSES && USE_NTLM2SESSION
   /* We don't support NTLM2 if we don't have USE_NTRESPONSES */
   if(ntlm->flags & NTLMFLAG_NEGOTIATE_NTLM2_KEY) {
     unsigned char ntbuffer[0x18];