mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
sasl_sspi: Corrected some of the GSSAPI security message error codes
Corrected a number of the error codes that can be returned from the
Curl_sasl_create_gssapi_security_message() function when things go
wrong.
It makes more sense to return CURLE_BAD_CONTENT_ENCODING when the
inbound security challenge can't be decoded correctly or doesn't
contain the KERB_WRAP_NO_ENCRYPT flag and CURLE_OUT_OF_MEMORY when
EncryptMessage() fails. Unfortunately the previous error code of
CURLE_RECV_ERROR was a copy and paste mistakes on my part and should
have been correct in commit 4b491c675f
:(
This commit is contained in:
parent
75be5a6681
commit
f6e15d25a3
@ -528,14 +528,14 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
|
|||||||
if(status != SEC_E_OK) {
|
if(status != SEC_E_OK) {
|
||||||
Curl_safefree(chlg);
|
Curl_safefree(chlg);
|
||||||
|
|
||||||
return CURLE_RECV_ERROR;
|
return CURLE_BAD_CONTENT_ENCODING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not 4 octets long to fail as per RFC4752 Section 3.1 */
|
/* Not 4 octets long to fail as per RFC4752 Section 3.1 */
|
||||||
if(input_buf[1].cbBuffer != 4) {
|
if(input_buf[1].cbBuffer != 4) {
|
||||||
Curl_safefree(chlg);
|
Curl_safefree(chlg);
|
||||||
|
|
||||||
return CURLE_RECV_ERROR;
|
return CURLE_BAD_CONTENT_ENCODING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Copy the data out into a coinput_bufnvenient variable and free the SSPI
|
/* Copy the data out into a coinput_bufnvenient variable and free the SSPI
|
||||||
@ -548,7 +548,7 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
|
|||||||
if(!(sec_layer & KERB_WRAP_NO_ENCRYPT)) {
|
if(!(sec_layer & KERB_WRAP_NO_ENCRYPT)) {
|
||||||
Curl_safefree(chlg);
|
Curl_safefree(chlg);
|
||||||
|
|
||||||
return CURLE_RECV_ERROR;
|
return CURLE_BAD_CONTENT_ENCODING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract the maximum message size the server can receive */
|
/* Extract the maximum message size the server can receive */
|
||||||
@ -621,7 +621,7 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
|
|||||||
Curl_safefree(trailer);
|
Curl_safefree(trailer);
|
||||||
Curl_safefree(chlg);
|
Curl_safefree(chlg);
|
||||||
|
|
||||||
return CURLE_RECV_ERROR;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate the encryption (wrap) buffer */
|
/* Allocate the encryption (wrap) buffer */
|
||||||
|
Loading…
Reference in New Issue
Block a user