25 #if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM) 47 #if defined(NTLM_NEEDS_NSS_INIT) 49 #elif defined(USE_WINDOWS_SSPI) 59 # define DEBUG_OUT(x) x 61 # define DEBUG_OUT(x) Curl_nop_stmt 70 struct ntlmdata *ntlm;
73 ntlm = proxy ? &conn->proxyntlm : &conn->ntlm;
76 header += strlen(
"NTLM");
78 while(*header &&
ISSPACE(*header))
82 result = Curl_auth_decode_ntlm_type2_message(conn->
data, header, ntlm);
90 infof(conn->
data,
"NTLM auth restarted\n");
91 Curl_http_ntlm_cleanup(conn);
94 infof(conn->
data,
"NTLM handshake rejected\n");
95 Curl_http_ntlm_cleanup(conn);
100 infof(conn->
data,
"NTLM handshake failure (internal error)\n");
129 struct ntlmdata *ntlm;
135 #if defined(NTLM_NEEDS_NSS_INIT) 144 ntlm = &conn->proxyntlm;
163 #ifdef USE_WINDOWS_SSPI 164 if(s_hSecDll == NULL) {
166 CURLcode err = Curl_sspi_global_init();
167 if(s_hSecDll == NULL)
172 switch(ntlm->state) {
176 result = Curl_auth_create_ntlm_type1_message(conn->
data, userp, passwdp,
177 ntlm, &base64, &len);
183 *allocuserpwd =
aprintf(
"%sAuthorization: NTLM %s\r\n",
184 proxy ?
"Proxy-" :
"",
190 DEBUG_OUT(
fprintf(stderr,
"**** Header %s\n ", *allocuserpwd));
196 result = Curl_auth_create_ntlm_type3_message(conn->
data, userp, passwdp,
197 ntlm, &base64, &len);
203 *allocuserpwd =
aprintf(
"%sAuthorization: NTLM %s\r\n",
204 proxy ?
"Proxy-" :
"",
210 DEBUG_OUT(
fprintf(stderr,
"**** %s\n ", *allocuserpwd));
231 void Curl_http_ntlm_cleanup(
struct connectdata *conn)
233 Curl_auth_ntlm_cleanup(&conn->ntlm);
234 Curl_auth_ntlm_cleanup(&conn->proxyntlm);
236 #if defined(NTLM_WB_ENABLED) 237 Curl_ntlm_wb_cleanup(conn);
UNITTEST_START int result
struct proxy_info http_proxy
#define Curl_safefree(ptr)
#define checkprefix(a, b)
struct connectdata::dynamically_allocated_data allocptr