From 5bf258bb2f34d6a956d50518df36b6ace22e1cb7 Mon Sep 17 00:00:00 2001 From: Soeren Bohn Date: Thu, 2 Mar 2017 15:32:21 +0100 Subject: [PATCH] Emits authorizationRequired signal before authentication in case of NTLM. Adds a new state to QAuthenticatorPrivate to ensure that the authorizationRequired signal is emitted before the request is sent. --- qtbase/src/network/access/qhttpnetworkconnection.cpp | 6 +++++- qtbase/src/network/kernel/qauthenticator_p.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/qtbase/src/network/access/qhttpnetworkconnection.cpp b/qtbase/src/network/access/qhttpnetworkconnection.cpp index c4cb8e6..5b09300 100644 --- a/qtbase/src/network/access/qhttpnetworkconnection.cpp +++ b/qtbase/src/network/access/qhttpnetworkconnection.cpp @@ -440,7 +440,11 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(*auth); priv->parseHttpResponse(fields, isProxy); - if (priv->phase == QAuthenticatorPrivate::Done) { + if (priv->phase == QAuthenticatorPrivate::Done || + (priv->phase == QAuthenticatorPrivate::Start && priv->method == QAuthenticatorPrivate::Ntlm)) { + if(priv->phase == QAuthenticatorPrivate::Start) + priv->phase = QAuthenticatorPrivate::Phase1; + pauseConnection(); if (!isProxy) { if (channels[i].authenticationCredentialsSent) { diff --git a/qtbase/src/network/kernel/qauthenticator_p.h b/qtbase/src/network/kernel/qauthenticator_p.h index 7fa2dc3..91ef554 100644 --- a/qtbase/src/network/kernel/qauthenticator_p.h +++ b/qtbase/src/network/kernel/qauthenticator_p.h @@ -79,6 +79,7 @@ public: enum Phase { Start, + Phase1, Phase2, Done, Invalid -- 2.8.1.windows.1