Blame SOURCES/negotiate-connection-close.patch

03cf34
diff -up libsoup-2.56.0/libsoup/soup-auth-negotiate.c.negotiate-connection-close libsoup-2.56.0/libsoup/soup-auth-negotiate.c
03cf34
--- libsoup-2.56.0/libsoup/soup-auth-negotiate.c.negotiate-connection-close	2017-06-20 14:38:57.074528827 +0200
03cf34
+++ libsoup-2.56.0/libsoup/soup-auth-negotiate.c	2017-06-20 14:40:02.165257249 +0200
03cf34
@@ -188,7 +188,29 @@ soup_auth_negotiate_get_connection_autho
03cf34
 	SoupNegotiateConnectionState *conn = state;
03cf34
 	char *header = NULL;
03cf34
 
03cf34
-	if (conn->state == SOUP_NEGOTIATE_RECEIVED_CHALLENGE) {
03cf34
+	if (conn->state == SOUP_NEGOTIATE_NEW) {
03cf34
+		GError *err = NULL;
03cf34
+
03cf34
+		if (!check_auth_trusted_uri (auth, msg)) {
03cf34
+			conn->state = SOUP_NEGOTIATE_FAILED;
03cf34
+			return NULL;
03cf34
+		}
03cf34
+
03cf34
+		if (!soup_gss_build_response (conn, SOUP_AUTH (auth), &err)) {
03cf34
+			/* FIXME: report further upward via
03cf34
+			 * soup_message_get_error_message  */
03cf34
+			if (conn->initialized)
03cf34
+				g_warning ("gssapi step failed: %s", err ? err->message : "Unknown error");
03cf34
+			else
03cf34
+				g_warning ("gssapi init failed: %s", err ? err->message : "Unknown error");
03cf34
+			conn->state = SOUP_NEGOTIATE_FAILED;
03cf34
+			g_clear_error (&err;;
03cf34
+
03cf34
+			return NULL;
03cf34
+		}
03cf34
+	}
03cf34
+
03cf34
+	if (conn->response_header) {
03cf34
 		header = conn->response_header;
03cf34
 		conn->response_header = NULL;
03cf34
 		conn->state = SOUP_NEGOTIATE_SENT_RESPONSE;
03cf34
@@ -251,7 +273,10 @@ soup_auth_negotiate_update_connection (S
03cf34
 		} else {
03cf34
 			/* FIXME: report further upward via
03cf34
 			 * soup_message_get_error_message  */
03cf34
-			g_warning ("gssapi step failed: %s", err ? err->message : "Unknown error");
03cf34
+			if (conn->initialized)
03cf34
+				g_warning ("gssapi step failed: %s", err ? err->message : "Unknown error");
03cf34
+			else
03cf34
+				g_warning ("gssapi init failed: %s", err ? err->message : "Unknown error");
03cf34
 			success = FALSE;
03cf34
 		}
03cf34
 	} else if (!strncmp (header, "Negotiate ", 10)) {