diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2020-08-03 13:25:04 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2020-08-05 11:32:01 +0200 |
commit | bbb3619a13526da5ec39fbfd62ab2e8150ed4fc3 (patch) | |
tree | d0941a92818b0ffbe582a88135203c1eb504723f | |
parent | e8997cb05e7f9da6c9c6951ea06262d937de4d72 (diff) |
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 <timur.pocheptsov@qt.io>
-rw-r--r-- | src/network/kernel/qauthenticator.cpp | 4 |
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; |