mirror of
https://github.com/moparisthebest/curl
synced 2025-03-03 10:51:49 -05:00
digest_sspi: Show InitializeSecurityContext errors in verbose mode
The error is shown with infof rather than failf so that the user will see the extended error message information only in verbose mode, and will still see the standard CURLE_AUTH_ERROR message. For example: --- * schannel: InitializeSecurityContext failed: SEC_E_QOP_NOT_SUPPORTED (0x8009030A) - The per-message Quality of Protection is not supported by the security package * multi_done * Connection #1 to host 127.0.0.1 left intact curl: (94) An authentication function returned an error --- Ref: https://github.com/curl/curl/issues/6302 Closes https://github.com/curl/curl/pull/6315
This commit is contained in:
parent
78af8b68cf
commit
c54565915f
@ -38,6 +38,7 @@
|
|||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
#include "strdup.h"
|
#include "strdup.h"
|
||||||
#include "strcase.h"
|
#include "strcase.h"
|
||||||
|
#include "strerror.h"
|
||||||
|
|
||||||
/* The last #include files should be: */
|
/* The last #include files should be: */
|
||||||
#include "curl_memory.h"
|
#include "curl_memory.h"
|
||||||
@ -220,6 +221,8 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
|||||||
status == SEC_I_COMPLETE_AND_CONTINUE)
|
status == SEC_I_COMPLETE_AND_CONTINUE)
|
||||||
s_pSecFn->CompleteAuthToken(&credentials, &resp_desc);
|
s_pSecFn->CompleteAuthToken(&credentials, &resp_desc);
|
||||||
else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) {
|
else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) {
|
||||||
|
char buffer[STRERROR_LEN];
|
||||||
|
|
||||||
s_pSecFn->FreeCredentialsHandle(&credentials);
|
s_pSecFn->FreeCredentialsHandle(&credentials);
|
||||||
Curl_sspi_free_identity(p_identity);
|
Curl_sspi_free_identity(p_identity);
|
||||||
free(spn);
|
free(spn);
|
||||||
@ -229,6 +232,9 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
|||||||
if(status == SEC_E_INSUFFICIENT_MEMORY)
|
if(status == SEC_E_INSUFFICIENT_MEMORY)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
infof(data, "schannel: InitializeSecurityContext failed: %s\n",
|
||||||
|
Curl_sspi_strerror(status, buffer, sizeof(buffer)));
|
||||||
|
|
||||||
return CURLE_AUTH_ERROR;
|
return CURLE_AUTH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -611,6 +617,8 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
|||||||
status == SEC_I_COMPLETE_AND_CONTINUE)
|
status == SEC_I_COMPLETE_AND_CONTINUE)
|
||||||
s_pSecFn->CompleteAuthToken(&credentials, &resp_desc);
|
s_pSecFn->CompleteAuthToken(&credentials, &resp_desc);
|
||||||
else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) {
|
else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) {
|
||||||
|
char buffer[STRERROR_LEN];
|
||||||
|
|
||||||
s_pSecFn->FreeCredentialsHandle(&credentials);
|
s_pSecFn->FreeCredentialsHandle(&credentials);
|
||||||
|
|
||||||
Curl_sspi_free_identity(p_identity);
|
Curl_sspi_free_identity(p_identity);
|
||||||
@ -621,6 +629,9 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
|||||||
if(status == SEC_E_INSUFFICIENT_MEMORY)
|
if(status == SEC_E_INSUFFICIENT_MEMORY)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
infof(data, "schannel: InitializeSecurityContext failed: %s\n",
|
||||||
|
Curl_sspi_strerror(status, buffer, sizeof(buffer)));
|
||||||
|
|
||||||
return CURLE_AUTH_ERROR;
|
return CURLE_AUTH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user