From bbb3619a13526da5ec39fbfd62ab2e8150ed4fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 3 Aug 2020 13:25:04 +0200 Subject: [PATCH] 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 Pick-to: 5.15 Fixes: QTBUG-85729 Reviewed-by: Timur Pocheptsov --- src/network/kernel/qauthenticator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 QListoptions[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;