|
|
03cf34 |
diff -up libsoup-2.56.0/libsoup/soup-auth-negotiate.c.tcms-site-warning libsoup-2.56.0/libsoup/soup-auth-negotiate.c
|
|
|
03cf34 |
--- libsoup-2.56.0/libsoup/soup-auth-negotiate.c.tcms-site-warning 2017-06-20 14:41:20.593930021 +0200
|
|
|
03cf34 |
+++ libsoup-2.56.0/libsoup/soup-auth-negotiate.c 2017-06-20 14:41:20.601929988 +0200
|
|
|
03cf34 |
@@ -364,13 +364,28 @@ check_server_response (SoupMessage *msg,
|
|
|
03cf34 |
|
|
|
03cf34 |
ret = soup_gss_client_step (conn, auth_headers + 10, &err;;
|
|
|
03cf34 |
|
|
|
03cf34 |
- priv->is_authenticated = ret == AUTH_GSS_COMPLETE;
|
|
|
03cf34 |
-
|
|
|
03cf34 |
- if (ret == AUTH_GSS_CONTINUE) {
|
|
|
03cf34 |
+ switch (ret) {
|
|
|
03cf34 |
+ case AUTH_GSS_COMPLETE:
|
|
|
03cf34 |
+ priv->is_authenticated = TRUE;
|
|
|
03cf34 |
+ break;
|
|
|
03cf34 |
+ case AUTH_GSS_CONTINUE:
|
|
|
03cf34 |
conn->state = SOUP_NEGOTIATE_RECEIVED_CHALLENGE;
|
|
|
03cf34 |
- } else if (ret == AUTH_GSS_ERROR) {
|
|
|
03cf34 |
+ break;
|
|
|
03cf34 |
+ case AUTH_GSS_ERROR:
|
|
|
03cf34 |
if (err)
|
|
|
03cf34 |
g_warning ("%s", err->message);
|
|
|
03cf34 |
+ /* Unfortunately, so many programs (curl, Firefox, ..) ignore
|
|
|
03cf34 |
+ * the return token that is included in the response, so it is
|
|
|
03cf34 |
+ * possible that there are servers that send back broken stuff.
|
|
|
03cf34 |
+ * Try to behave in the right way (pass the token to
|
|
|
03cf34 |
+ * gss_init_sec_context()), show a warning, but don't fail
|
|
|
03cf34 |
+ * if the server returned 200. */
|
|
|
03cf34 |
+ if (msg->status_code == SOUP_STATUS_OK)
|
|
|
03cf34 |
+ priv->is_authenticated = TRUE;
|
|
|
03cf34 |
+ else
|
|
|
03cf34 |
+ conn->state = SOUP_NEGOTIATE_FAILED;
|
|
|
03cf34 |
+ break;
|
|
|
03cf34 |
+ default:
|
|
|
03cf34 |
conn->state = SOUP_NEGOTIATE_FAILED;
|
|
|
03cf34 |
}
|
|
|
03cf34 |
out:
|