]> granicus.if.org Git - curl/commitdiff
Don't clear GSSAPI state between each exchange in the negotiation
authorDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 11 Jul 2014 10:09:34 +0000 (11:09 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 16 Jul 2014 15:26:08 +0000 (17:26 +0200)
GSSAPI doesn't work very well if we forget everything ever time.

XX: Is Curl_http_done() the right place to do the final cleanup?

lib/http.c
lib/http_negotiate.c
lib/http_negotiate_sspi.c

index 78791ee1af3194943c5eb2ee96922e16dfcc5f34..91060567e3c77d6b7377ff2fac5e20b76ec67b32 100644 (file)
@@ -1443,6 +1443,12 @@ CURLcode Curl_http_done(struct connectdata *conn,
 
   Curl_unencode_cleanup(conn);
 
+#ifdef USE_HTTP_NEGOTIATE
+  if(data->state.proxyneg.state == GSS_AUTHSENT ||
+      data->state.negotiate.state == GSS_AUTHSENT)
+    Curl_cleanup_negotiate(data);
+#endif
+
   /* set the proper values (possibly modified on POST) */
   conn->fread_func = data->set.fread_func; /* restore */
   conn->fread_in = data->set.in; /* restore */
index 9b01e0a5638a9d4c1f256e936d939f4e1991c7c3..bbad0b4595e0d4f9cfda62d04aba93c360987730 100644 (file)
@@ -250,7 +250,6 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
   }
 
   Curl_safefree(encoded);
-  Curl_cleanup_negotiate(conn->data);
 
   return (userp == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK;
 }
index 8396a6197829798923a38399a0bce9ec0853050d..236766b16ebb856362cb8f78b3ea75eb8a35a856 100644 (file)
@@ -268,7 +268,6 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
   else
     conn->allocptr.userpwd = userp;
   free(encoded);
-  Curl_cleanup_negotiate (conn->data);
   return (userp == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK;
 }