Lines Matching refs:nego
87 * nego [in/out] - The Negotiate data struct being used and modified.
97 struct negotiatedata *nego)
114 if(nego->context && nego->status == SEC_E_OK) {
118 Curl_auth_cleanup_spnego(nego);
122 if(!nego->spn) {
124 nego->spn = Curl_auth_build_spn(service, host, NULL);
125 if(!nego->spn)
129 if(!nego->output_token) {
131 nego->status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *)
134 if(nego->status != SEC_E_OK) {
139 nego->token_max = SecurityPackage->cbMaxToken;
145 nego->output_token = malloc(nego->token_max);
146 if(!nego->output_token)
150 if(!nego->credentials) {
154 result = Curl_create_sspi_identity(user, password, &nego->identity);
159 nego->p_identity = &nego->identity;
163 nego->p_identity = NULL;
166 nego->credentials = calloc(1, sizeof(CredHandle));
167 if(!nego->credentials)
171 nego->status =
175 nego->p_identity, NULL, NULL,
176 nego->credentials, &expiry);
177 if(nego->status != SEC_E_OK)
181 nego->context = calloc(1, sizeof(CtxtHandle));
182 if(!nego->context)
217 if(nego->sslContext) {
221 nego->status = s_pSecFn->QueryContextAttributes(
222 nego->sslContext,
226 if(nego->status == SEC_E_OK) {
241 resp_buf.pvBuffer = nego->output_token;
242 resp_buf.cbBuffer = curlx_uztoul(nego->token_max);
245 nego->status = s_pSecFn->InitializeSecurityContext(nego->credentials,
246 chlg ? nego->context :
248 nego->spn,
252 0, nego->context,
259 if(GSS_ERROR(nego->status)) {
262 Curl_sspi_strerror(nego->status, buffer, sizeof(buffer)));
264 if(nego->status == (DWORD)SEC_E_INSUFFICIENT_MEMORY)
270 if(nego->status == SEC_I_COMPLETE_NEEDED ||
271 nego->status == SEC_I_COMPLETE_AND_CONTINUE) {
272 nego->status = s_pSecFn->CompleteAuthToken(nego->context, &resp_desc);
273 if(GSS_ERROR(nego->status)) {
276 Curl_sspi_strerror(nego->status, buffer, sizeof(buffer)));
278 if(nego->status == (DWORD)SEC_E_INSUFFICIENT_MEMORY)
285 nego->output_token_length = resp_buf.cbBuffer;
299 * nego [in/out] - The Negotiate data struct being used and modified.
306 CURLcode Curl_auth_create_spnego_message(struct negotiatedata *nego,
310 CURLcode result = Curl_base64_encode((const char *) nego->output_token,
311 nego->output_token_length, outptr,
328 * nego [in/out] - The Negotiate data struct being cleaned up.
331 void Curl_auth_cleanup_spnego(struct negotiatedata *nego)
334 if(nego->context) {
335 s_pSecFn->DeleteSecurityContext(nego->context);
336 free(nego->context);
337 nego->context = NULL;
341 if(nego->credentials) {
342 s_pSecFn->FreeCredentialsHandle(nego->credentials);
343 free(nego->credentials);
344 nego->credentials = NULL;
348 Curl_sspi_free_identity(nego->p_identity);
349 nego->p_identity = NULL;
352 Curl_safefree(nego->spn);
353 Curl_safefree(nego->output_token);
356 nego->status = 0;
357 nego->token_max = 0;
358 nego->noauthpersist = FALSE;
359 nego->havenoauthpersist = FALSE;
360 nego->havenegdata = FALSE;
361 nego->havemultiplerequests = FALSE;