diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-06-03 13:43:42 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-06-03 13:43:42 +0300 |
commit | f3af3be2595966b74968295df1e919b2a47b5794 (patch) | |
tree | c56b64155e38de1abe5afd03bbee474cd6420fcd | |
parent | 0d7d95be93cf84655e446f11a8ae00455f4a0104 (diff) | |
parent | 42b98d33481d4f50f04d27cc0568021920599f72 (diff) |
Merge tag 'v6.5.6-lts-lgpl' into 6.56.5
Qt 6.5.6-lts-lgpl release
-rw-r--r-- | .cmake.conf | 2 | ||||
-rw-r--r-- | coin/module_config.yaml | 1 | ||||
-rw-r--r-- | dependencies.yaml | 2 | ||||
-rw-r--r-- | src/oauth/qabstractoauth.cpp | 15 |
4 files changed, 14 insertions, 6 deletions
diff --git a/.cmake.conf b/.cmake.conf index a3856a4..1aa29ce 100644 --- a/.cmake.conf +++ b/.cmake.conf @@ -1,3 +1,3 @@ -set(QT_REPO_MODULE_VERSION "6.5.5") +set(QT_REPO_MODULE_VERSION "6.5.6") set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1") set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1") diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 16d158c..d943c2c 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -1,4 +1,5 @@ version: 2 +alias: qtnetworkauth accept_configuration: condition: property property: features diff --git a/dependencies.yaml b/dependencies.yaml index 47eef69..0a37caa 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -1,4 +1,4 @@ dependencies: ../tqtc-qtbase: - ref: fdf57f5df57e7d12cf871699d857a71acf272e0c + ref: 5d8e9a8415562ba004b38508d91e1fa0254c17d3 required: true diff --git a/src/oauth/qabstractoauth.cpp b/src/oauth/qabstractoauth.cpp index aff998a..e6589bb 100644 --- a/src/oauth/qabstractoauth.cpp +++ b/src/oauth/qabstractoauth.cpp @@ -11,7 +11,6 @@ #include <QtCore/qurl.h> #include <QtCore/qpair.h> #include <QtCore/qstring.h> -#include <QtCore/qdatetime.h> #include <QtCore/qurlquery.h> #include <QtCore/qjsondocument.h> #include <QtCore/qmessageauthenticationcode.h> @@ -20,6 +19,9 @@ #include <QtNetwork/qnetworkaccessmanager.h> #include <QtNetwork/qnetworkreply.h> +#include <QtCore/qrandom.h> +#include <QtCore/private/qlocking_p.h> + #include <random> QT_BEGIN_NAMESPACE @@ -262,15 +264,19 @@ void QAbstractOAuthPrivate::setStatus(QAbstractOAuth::Status newStatus) } } +Q_CONSTINIT static QBasicMutex prngMutex; +Q_GLOBAL_STATIC_WITH_ARGS(std::mt19937, prng, (*QRandomGenerator::system())) + QByteArray QAbstractOAuthPrivate::generateRandomString(quint8 length) { - const char characters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - static std::mt19937 randomEngine(QDateTime::currentDateTime().toMSecsSinceEpoch()); + constexpr char characters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; std::uniform_int_distribution<int> distribution(0, sizeof(characters) - 2); QByteArray data; data.reserve(length); + auto lock = qt_unique_lock(prngMutex); for (quint8 i = 0; i < length; ++i) - data.append(characters[distribution(randomEngine)]); + data.append(characters[distribution(*prng)]); + lock.unlock(); return data; } @@ -580,6 +586,7 @@ void QAbstractOAuth::resourceOwnerAuthorization(const QUrl &url, const QMultiMap } /*! + \threadsafe Generates a random string which could be used as state or nonce. The parameter \a length determines the size of the generated string. |