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