diff options
author | dartraiden <wowemuh@gmail.com> | 2021-02-07 18:49:47 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2021-02-07 18:49:47 +0300 |
commit | 2f0eaffffe7e5d3ac074797f880480494dbcc6f3 (patch) | |
tree | 161fa6a6df8387d618530a684de9f61f58640596 /libs/libcurl/src/vauth | |
parent | 061f5621d3f64835c376a7781af86a5e5ee1145c (diff) |
libcurl: update to 7.75.0
Diffstat (limited to 'libs/libcurl/src/vauth')
-rw-r--r-- | libs/libcurl/src/vauth/digest.c | 14 | ||||
-rw-r--r-- | libs/libcurl/src/vauth/digest_sspi.c | 15 | ||||
-rw-r--r-- | libs/libcurl/src/vauth/krb5_sspi.c | 2 | ||||
-rw-r--r-- | libs/libcurl/src/vauth/ntlm_sspi.c | 2 | ||||
-rw-r--r-- | libs/libcurl/src/vauth/spnego_sspi.c | 2 |
5 files changed, 24 insertions, 11 deletions
diff --git a/libs/libcurl/src/vauth/digest.c b/libs/libcurl/src/vauth/digest.c index 5fc9285263..559852fcba 100644 --- a/libs/libcurl/src/vauth/digest.c +++ b/libs/libcurl/src/vauth/digest.c @@ -61,12 +61,14 @@ It converts digest text to ASCII so the MD5 will be correct for what ultimately goes over the network. */ -#define CURL_OUTPUT_DIGEST_CONV(a, b) \ - result = Curl_convert_to_network(a, b, strlen(b)); \ - if(result) { \ - free(b); \ - return result; \ - } +#define CURL_OUTPUT_DIGEST_CONV(a, b) \ + do { \ + result = Curl_convert_to_network(a, b, strlen(b)); \ + if(result) { \ + free(b); \ + return result; \ + } \ + } while(0) #endif /* !USE_WINDOWS_SSPI */ bool Curl_auth_digest_get_pair(const char *str, char *value, char *content, diff --git a/libs/libcurl/src/vauth/digest_sspi.c b/libs/libcurl/src/vauth/digest_sspi.c index 91d18c992b..dad947a37e 100644 --- a/libs/libcurl/src/vauth/digest_sspi.c +++ b/libs/libcurl/src/vauth/digest_sspi.c @@ -38,6 +38,7 @@ #include "sendf.h" #include "strdup.h" #include "strcase.h" +#include "strerror.h" /* The last #include files should be: */ #include "curl_memory.h" @@ -134,7 +135,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, if(status != SEC_E_OK) { free(input_token); - failf(data, "SSPI: couldn't get auth info\n"); + failf(data, "SSPI: couldn't get auth info"); return CURLE_AUTH_ERROR; } @@ -220,6 +221,8 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, status == SEC_I_COMPLETE_AND_CONTINUE) s_pSecFn->CompleteAuthToken(&credentials, &resp_desc); else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) { + char buffer[STRERROR_LEN]; + s_pSecFn->FreeCredentialsHandle(&credentials); Curl_sspi_free_identity(p_identity); free(spn); @@ -229,6 +232,9 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, if(status == SEC_E_INSUFFICIENT_MEMORY) return CURLE_OUT_OF_MEMORY; + infof(data, "schannel: InitializeSecurityContext failed: %s\n", + Curl_sspi_strerror(status, buffer, sizeof(buffer))); + return CURLE_AUTH_ERROR; } @@ -433,7 +439,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_DIGEST), &SecurityPackage); if(status != SEC_E_OK) { - failf(data, "SSPI: couldn't get auth info\n"); + failf(data, "SSPI: couldn't get auth info"); 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) s_pSecFn->CompleteAuthToken(&credentials, &resp_desc); else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) { + char buffer[STRERROR_LEN]; + s_pSecFn->FreeCredentialsHandle(&credentials); 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) return CURLE_OUT_OF_MEMORY; + infof(data, "schannel: InitializeSecurityContext failed: %s\n", + Curl_sspi_strerror(status, buffer, sizeof(buffer))); + return CURLE_AUTH_ERROR; } diff --git a/libs/libcurl/src/vauth/krb5_sspi.c b/libs/libcurl/src/vauth/krb5_sspi.c index 8e56a82409..b2d1635343 100644 --- a/libs/libcurl/src/vauth/krb5_sspi.c +++ b/libs/libcurl/src/vauth/krb5_sspi.c @@ -125,7 +125,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, TEXT(SP_NAME_KERBEROS), &SecurityPackage); if(status != SEC_E_OK) { - failf(data, "SSPI: couldn't get auth info\n"); + failf(data, "SSPI: couldn't get auth info"); return CURLE_AUTH_ERROR; } diff --git a/libs/libcurl/src/vauth/ntlm_sspi.c b/libs/libcurl/src/vauth/ntlm_sspi.c index 28bc3efdaa..07dc97398e 100644 --- a/libs/libcurl/src/vauth/ntlm_sspi.c +++ b/libs/libcurl/src/vauth/ntlm_sspi.c @@ -106,7 +106,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_NTLM), &SecurityPackage); if(status != SEC_E_OK) { - failf(data, "SSPI: couldn't get auth info\n"); + failf(data, "SSPI: couldn't get auth info"); return CURLE_AUTH_ERROR; } diff --git a/libs/libcurl/src/vauth/spnego_sspi.c b/libs/libcurl/src/vauth/spnego_sspi.c index e7482a43e2..4aa1ba9572 100644 --- a/libs/libcurl/src/vauth/spnego_sspi.c +++ b/libs/libcurl/src/vauth/spnego_sspi.c @@ -130,7 +130,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, TEXT(SP_NAME_NEGOTIATE), &SecurityPackage); if(nego->status != SEC_E_OK) { - failf(data, "SSPI: couldn't get auth info\n"); + failf(data, "SSPI: couldn't get auth info"); return CURLE_AUTH_ERROR; } |