summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/vauth/spnego_sspi.c
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-09-17 12:36:24 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-09-17 12:36:24 +0300
commitfe2500aa99137c9ce35907c118745d65a0c0c07e (patch)
tree5b4024359b5344b1490f7568bfb6dec897cd1aae /libs/libcurl/src/vauth/spnego_sspi.c
parentadbda1ab567b2baf45c80a62a6aa4c3171a5c2e3 (diff)
libcurl updated to 7.66
Diffstat (limited to 'libs/libcurl/src/vauth/spnego_sspi.c')
-rw-r--r--libs/libcurl/src/vauth/spnego_sspi.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/libs/libcurl/src/vauth/spnego_sspi.c b/libs/libcurl/src/vauth/spnego_sspi.c
index 4b21cc769e..b9c2cf7d62 100644
--- a/libs/libcurl/src/vauth/spnego_sspi.c
+++ b/libs/libcurl/src/vauth/spnego_sspi.c
@@ -59,6 +59,12 @@ bool Curl_auth_is_spnego_supported(void)
TEXT(SP_NAME_NEGOTIATE),
&SecurityPackage);
+ /* Release the package buffer as it is not required anymore */
+ if(status == SEC_E_OK) {
+ s_pSecFn->FreeContextBuffer(SecurityPackage);
+ }
+
+
return (status == SEC_E_OK ? TRUE : FALSE);
}
@@ -165,7 +171,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
nego->p_identity, NULL, NULL,
nego->credentials, &expiry);
if(nego->status != SEC_E_OK)
- return CURLE_LOGIN_DENIED;
+ return CURLE_AUTH_ERROR;
/* Allocate our new context handle */
nego->context = calloc(1, sizeof(CtxtHandle));
@@ -251,14 +257,25 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
char buffer[STRERROR_LEN];
failf(data, "InitializeSecurityContext failed: %s",
Curl_sspi_strerror(nego->status, buffer, sizeof(buffer)));
- return CURLE_OUT_OF_MEMORY;
+
+ if(nego->status == (DWORD)SEC_E_INSUFFICIENT_MEMORY)
+ return CURLE_OUT_OF_MEMORY;
+
+ return CURLE_AUTH_ERROR;
}
if(nego->status == SEC_I_COMPLETE_NEEDED ||
nego->status == SEC_I_COMPLETE_AND_CONTINUE) {
nego->status = s_pSecFn->CompleteAuthToken(nego->context, &resp_desc);
if(GSS_ERROR(nego->status)) {
- return CURLE_RECV_ERROR;
+ char buffer[STRERROR_LEN];
+ failf(data, "CompleteAuthToken failed: %s",
+ Curl_sspi_strerror(nego->status, buffer, sizeof(buffer)));
+
+ if(nego->status == (DWORD)SEC_E_INSUFFICIENT_MEMORY)
+ return CURLE_OUT_OF_MEMORY;
+
+ return CURLE_AUTH_ERROR;
}
}