1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

krb5_sspi: Only generate the output token when its not allocated

Prior to this change, we were generating the output token when the
credentials were NULL rather than when the output token was NULL.

This also brings this part of the Kerberos 5 code in line with the
Negotiate code.
This commit is contained in:
Steve Holme 2016-04-03 11:25:12 +01:00
parent 2d2c67e3ed
commit 228cd71c6f

View File

@ -92,7 +92,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
return CURLE_OUT_OF_MEMORY; return CURLE_OUT_OF_MEMORY;
} }
if(!krb5->credentials) { if(!krb5->output_token) {
/* Query the security package for Kerberos */ /* Query the security package for Kerberos */
status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *)
TEXT(SP_NAME_KERBEROS), TEXT(SP_NAME_KERBEROS),
@ -110,7 +110,9 @@ CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
krb5->output_token = malloc(krb5->token_max); krb5->output_token = malloc(krb5->token_max);
if(!krb5->output_token) if(!krb5->output_token)
return CURLE_OUT_OF_MEMORY; return CURLE_OUT_OF_MEMORY;
}
if(!krb5->credentials) {
if(userp && *userp) { if(userp && *userp) {
/* Populate our identity structure */ /* Populate our identity structure */
result = Curl_create_sspi_identity(userp, passwdp, &krb5->identity); result = Curl_create_sspi_identity(userp, passwdp, &krb5->identity);