summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSören Bohn <soeren.bohn@clausmark.com>2017-03-14 10:36:49 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-02-02 07:10:12 +0100
commit0b7b3a069e003477f92302aaeb645d8a6f27e9fa (patch)
treeffc68ba18ee41db826633f11e71c1980c17b3a5f
parent5a0849ed6b44657f3b680ab552d5f0ca4a9261d3 (diff)
Network: Emit authenticationRequired when using Ntlm
Adds a new state Phase1 to QAuthenticatorPrivate::Phase which is used when authenticating using Ntlm. The new state forces an emit of the authenticationRequired signal and tracks that it is called only once. Fixes: QTBUG-44096 Pick-to: 6.2 6.3 5.15 Change-Id: Icc9662d4fdc1f0f8c8e8bc5538f211baaa055d4c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp7
-rw-r--r--src/network/kernel/qauthenticator_p.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 50cce3a142..68c7b39d61 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -454,7 +454,12 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
if (priv->method == QAuthenticatorPrivate::None)
return false;
- 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/src/network/kernel/qauthenticator_p.h b/src/network/kernel/qauthenticator_p.h
index 6cdff484a2..3a2585eb76 100644
--- a/src/network/kernel/qauthenticator_p.h
+++ b/src/network/kernel/qauthenticator_p.h
@@ -91,6 +91,7 @@ public:
enum Phase {
Start,
+ Phase1,
Phase2,
Done,
Invalid