]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sasl_sspi: Corrected some of the GSSAPI security message error codes
authorSteve Holme <steve_holme@hotmail.com>
Sun, 17 Aug 2014 21:36:22 +0000 (22:36 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 17 Aug 2014 21:38:25 +0000 (22:38 +0100)
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 :(

lib/curl_sasl_sspi.c

index 95f5d90aa3171b96de527a6be40de5cfeaa291bb..e1c8a57dc9f72fe65ae1ac31af7853cf0960a3d3 100644 (file)
@@ -528,14 +528,14 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
   if(status != SEC_E_OK) {
     Curl_safefree(chlg);
 
-    return CURLE_RECV_ERROR;
+    return CURLE_BAD_CONTENT_ENCODING;
   }
 
   /* Not 4 octets long to fail as per RFC4752 Section 3.1 */
   if(input_buf[1].cbBuffer != 4) {
     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
@@ -548,7 +548,7 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
   if(!(sec_layer & KERB_WRAP_NO_ENCRYPT)) {
     Curl_safefree(chlg);
 
-    return CURLE_RECV_ERROR;
+    return CURLE_BAD_CONTENT_ENCODING;
   }
 
   /* 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(chlg);
 
-    return CURLE_RECV_ERROR;
+    return CURLE_OUT_OF_MEMORY;
   }
 
   /* Allocate the encryption (wrap) buffer */