summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMÃ¥rten Nordheim <marten.nordheim@qt.io>2020-08-03 13:25:04 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-08-05 11:58:00 +0000
commit52ef2b60051ff57d497b29dedaca21423dc7566b (patch)
tree10e60eb0f1ef54410ab286c9e5e08ff69a334f12
parent5d9e7e7305fc0cbed8f7be80fb996f3ac653ff75 (diff)
downloadqtbase-52ef2b60051ff57d497b29dedaca21423dc7566b.tar.gz
QAuth.: Reset the nonce-count when the server requests using a new nonce
Some servers have an upper limit on how many times a nonce can be reused. Because the nc was not being reset the server would get a high nc and would close the connection. Change-Id: I71d5a316f79777a45c7323d93e28b3845aefcfad Original-patch-by: Benjamin Reikowski Fixes: QTBUG-85729 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit bbb3619a13526da5ec39fbfd62ab2e8150ed4fc3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/network/kernel/qauthenticator.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index 3ac54605e4..1aeac6a589 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -463,8 +463,10 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
break;
case DigestMd5: {
this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
- if (options.value("stale").compare("true", Qt::CaseInsensitive) == 0)
+ if (options.value("stale").compare("true", Qt::CaseInsensitive) == 0) {
phase = Start;
+ nonceCount = 0;
+ }
if (user.isEmpty() && password.isEmpty())
phase = Done;
break;