Skip to content

Commit

Permalink
sspi: Return CURLE_LOGIN_DENIED on AcquireCredentialsHandle() failure
Browse files Browse the repository at this point in the history
Return a more appropriate error, rather than CURLE_OUT_OF_MEMORY when
acquiring the credentials handle fails. This is then consistent with
the code prior to commit f7e2468 when log-in credentials were empty.
  • Loading branch information
captain-caveman2k committed Oct 29, 2014
1 parent f7e2468 commit f3fc3d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/curl_ntlm_msgs.c
Expand Up @@ -477,7 +477,7 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp,
ntlm->p_identity, NULL, NULL,
ntlm->credentials, &expiry);
if(status != SEC_E_OK)
return CURLE_OUT_OF_MEMORY;
return CURLE_LOGIN_DENIED;

/* Allocate our new context handle */
ntlm->context = malloc(sizeof(CtxtHandle));
Expand Down
4 changes: 2 additions & 2 deletions lib/curl_sasl_sspi.c
Expand Up @@ -210,7 +210,7 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data,
Curl_safefree(resp);
Curl_safefree(chlg);

return CURLE_OUT_OF_MEMORY;
return CURLE_LOGIN_DENIED;
}

/* Setup the challenge "input" security buffer */
Expand Down Expand Up @@ -367,7 +367,7 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data,
krb5->p_identity, NULL, NULL,
krb5->credentials, &expiry);
if(status != SEC_E_OK)
return CURLE_OUT_OF_MEMORY;
return CURLE_LOGIN_DENIED;

/* Allocate our new context handle */
krb5->context = malloc(sizeof(CtxtHandle));
Expand Down

0 comments on commit f3fc3d0

Please sign in to comment.