Lines Matching refs:ntlm
92 struct ntlmdata *ntlm, in Curl_auth_create_ntlm_type1_message() argument
103 Curl_auth_cleanup_ntlm(ntlm); in Curl_auth_create_ntlm_type1_message()
113 ntlm->token_max = SecurityPackage->cbMaxToken; in Curl_auth_create_ntlm_type1_message()
119 ntlm->output_token = malloc(ntlm->token_max); in Curl_auth_create_ntlm_type1_message()
120 if(!ntlm->output_token) in Curl_auth_create_ntlm_type1_message()
127 result = Curl_create_sspi_identity(userp, passwdp, &ntlm->identity); in Curl_auth_create_ntlm_type1_message()
132 ntlm->p_identity = &ntlm->identity; in Curl_auth_create_ntlm_type1_message()
136 ntlm->p_identity = NULL; in Curl_auth_create_ntlm_type1_message()
139 ntlm->credentials = calloc(1, sizeof(CredHandle)); in Curl_auth_create_ntlm_type1_message()
140 if(!ntlm->credentials) in Curl_auth_create_ntlm_type1_message()
147 ntlm->p_identity, NULL, NULL, in Curl_auth_create_ntlm_type1_message()
148 ntlm->credentials, &expiry); in Curl_auth_create_ntlm_type1_message()
153 ntlm->context = calloc(1, sizeof(CtxtHandle)); in Curl_auth_create_ntlm_type1_message()
154 if(!ntlm->context) in Curl_auth_create_ntlm_type1_message()
157 ntlm->spn = Curl_auth_build_spn(service, host, NULL); in Curl_auth_create_ntlm_type1_message()
158 if(!ntlm->spn) in Curl_auth_create_ntlm_type1_message()
166 type_1_buf.pvBuffer = ntlm->output_token; in Curl_auth_create_ntlm_type1_message()
167 type_1_buf.cbBuffer = curlx_uztoul(ntlm->token_max); in Curl_auth_create_ntlm_type1_message()
170 status = Curl_pSecFn->InitializeSecurityContext(ntlm->credentials, NULL, in Curl_auth_create_ntlm_type1_message()
171 ntlm->spn, in Curl_auth_create_ntlm_type1_message()
174 ntlm->context, &type_1_desc, in Curl_auth_create_ntlm_type1_message()
178 Curl_pSecFn->CompleteAuthToken(ntlm->context, &type_1_desc); in Curl_auth_create_ntlm_type1_message()
185 Curl_bufref_set(out, ntlm->output_token, type_1_buf.cbBuffer, NULL); in Curl_auth_create_ntlm_type1_message()
204 struct ntlmdata *ntlm) in Curl_auth_decode_ntlm_type2_message() argument
217 ntlm->input_token = Curl_memdup0((const char *)Curl_bufref_ptr(type2), in Curl_auth_decode_ntlm_type2_message()
219 if(!ntlm->input_token) in Curl_auth_decode_ntlm_type2_message()
221 ntlm->input_token_len = Curl_bufref_len(type2); in Curl_auth_decode_ntlm_type2_message()
246 struct ntlmdata *ntlm, in Curl_auth_create_ntlm_type3_message() argument
269 type_2_bufs[0].pvBuffer = ntlm->input_token; in Curl_auth_create_ntlm_type3_message()
270 type_2_bufs[0].cbBuffer = curlx_uztoul(ntlm->input_token_len); in Curl_auth_create_ntlm_type3_message()
281 if(ntlm->sslContext) { in Curl_auth_create_ntlm_type3_message()
286 ntlm->sslContext, in Curl_auth_create_ntlm_type3_message()
304 type_3_buf.pvBuffer = ntlm->output_token; in Curl_auth_create_ntlm_type3_message()
305 type_3_buf.cbBuffer = curlx_uztoul(ntlm->token_max); in Curl_auth_create_ntlm_type3_message()
308 status = Curl_pSecFn->InitializeSecurityContext(ntlm->credentials, in Curl_auth_create_ntlm_type3_message()
309 ntlm->context, in Curl_auth_create_ntlm_type3_message()
310 ntlm->spn, in Curl_auth_create_ntlm_type3_message()
313 0, ntlm->context, in Curl_auth_create_ntlm_type3_message()
327 result = Curl_bufref_memdup(out, ntlm->output_token, type_3_buf.cbBuffer); in Curl_auth_create_ntlm_type3_message()
328 Curl_auth_cleanup_ntlm(ntlm); in Curl_auth_create_ntlm_type3_message()
342 void Curl_auth_cleanup_ntlm(struct ntlmdata *ntlm) in Curl_auth_cleanup_ntlm() argument
345 if(ntlm->context) { in Curl_auth_cleanup_ntlm()
346 Curl_pSecFn->DeleteSecurityContext(ntlm->context); in Curl_auth_cleanup_ntlm()
347 free(ntlm->context); in Curl_auth_cleanup_ntlm()
348 ntlm->context = NULL; in Curl_auth_cleanup_ntlm()
352 if(ntlm->credentials) { in Curl_auth_cleanup_ntlm()
353 Curl_pSecFn->FreeCredentialsHandle(ntlm->credentials); in Curl_auth_cleanup_ntlm()
354 free(ntlm->credentials); in Curl_auth_cleanup_ntlm()
355 ntlm->credentials = NULL; in Curl_auth_cleanup_ntlm()
359 Curl_sspi_free_identity(ntlm->p_identity); in Curl_auth_cleanup_ntlm()
360 ntlm->p_identity = NULL; in Curl_auth_cleanup_ntlm()
363 Curl_safefree(ntlm->input_token); in Curl_auth_cleanup_ntlm()
364 Curl_safefree(ntlm->output_token); in Curl_auth_cleanup_ntlm()
367 ntlm->token_max = 0; in Curl_auth_cleanup_ntlm()
369 Curl_safefree(ntlm->spn); in Curl_auth_cleanup_ntlm()