Lines Matching refs:ntlm
91 struct ntlmdata *ntlm, in Curl_auth_create_ntlm_type1_message() argument
102 Curl_auth_cleanup_ntlm(ntlm); in Curl_auth_create_ntlm_type1_message()
112 ntlm->token_max = SecurityPackage->cbMaxToken; in Curl_auth_create_ntlm_type1_message()
118 ntlm->output_token = malloc(ntlm->token_max); in Curl_auth_create_ntlm_type1_message()
119 if(!ntlm->output_token) in Curl_auth_create_ntlm_type1_message()
126 result = Curl_create_sspi_identity(userp, passwdp, &ntlm->identity); in Curl_auth_create_ntlm_type1_message()
131 ntlm->p_identity = &ntlm->identity; in Curl_auth_create_ntlm_type1_message()
135 ntlm->p_identity = NULL; in Curl_auth_create_ntlm_type1_message()
138 ntlm->credentials = calloc(1, sizeof(CredHandle)); in Curl_auth_create_ntlm_type1_message()
139 if(!ntlm->credentials) in Curl_auth_create_ntlm_type1_message()
146 ntlm->p_identity, NULL, NULL, in Curl_auth_create_ntlm_type1_message()
147 ntlm->credentials, &expiry); in Curl_auth_create_ntlm_type1_message()
152 ntlm->context = calloc(1, sizeof(CtxtHandle)); in Curl_auth_create_ntlm_type1_message()
153 if(!ntlm->context) in Curl_auth_create_ntlm_type1_message()
156 ntlm->spn = Curl_auth_build_spn(service, host, NULL); in Curl_auth_create_ntlm_type1_message()
157 if(!ntlm->spn) in Curl_auth_create_ntlm_type1_message()
165 type_1_buf.pvBuffer = ntlm->output_token; in Curl_auth_create_ntlm_type1_message()
166 type_1_buf.cbBuffer = curlx_uztoul(ntlm->token_max); in Curl_auth_create_ntlm_type1_message()
169 status = s_pSecFn->InitializeSecurityContext(ntlm->credentials, NULL, in Curl_auth_create_ntlm_type1_message()
170 ntlm->spn, in Curl_auth_create_ntlm_type1_message()
173 ntlm->context, &type_1_desc, in Curl_auth_create_ntlm_type1_message()
177 s_pSecFn->CompleteAuthToken(ntlm->context, &type_1_desc); in Curl_auth_create_ntlm_type1_message()
184 Curl_bufref_set(out, ntlm->output_token, type_1_buf.cbBuffer, NULL); in Curl_auth_create_ntlm_type1_message()
203 struct ntlmdata *ntlm) in Curl_auth_decode_ntlm_type2_message() argument
216 ntlm->input_token = malloc(Curl_bufref_len(type2) + 1); in Curl_auth_decode_ntlm_type2_message()
217 if(!ntlm->input_token) in Curl_auth_decode_ntlm_type2_message()
219 memcpy(ntlm->input_token, Curl_bufref_ptr(type2), Curl_bufref_len(type2)); in Curl_auth_decode_ntlm_type2_message()
220 ntlm->input_token[Curl_bufref_len(type2)] = '\0'; 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 = s_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 s_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 s_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()