summaryrefslogtreecommitdiffstats
path: root/src/oauth/qoauth2authorizationcodeflow.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-06-13 17:58:25 +0200
committerMarc Mutz <marc.mutz@qt.io>2024-06-24 05:23:47 +0000
commit0c7fb076f8f1afb616a251217497223a377d3b2d (patch)
tree986c46a53e6106eda9031ed2e07792afc2c3b455 /src/oauth/qoauth2authorizationcodeflow.cpp
parentab951d2e42c95aa6a2e0cc8718c57d19278318d6 (diff)
QOAuth2AuthorizationCodeFlow: take setPkceMethod()'s length as qsizetype
This prevents accidental narrowing on the call-side (and isn't slower than passing a shorter integer, which is the reason we don't use qint64 here). Found in API-Review. Pick-to: 6.8 Change-Id: I9c0cdc67ddf9d5d1bd6ccdbc8d860ffa874daf33 Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Diffstat (limited to 'src/oauth/qoauth2authorizationcodeflow.cpp')
-rw-r--r--src/oauth/qoauth2authorizationcodeflow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/oauth/qoauth2authorizationcodeflow.cpp b/src/oauth/qoauth2authorizationcodeflow.cpp
index e780335..3951546 100644
--- a/src/oauth/qoauth2authorizationcodeflow.cpp
+++ b/src/oauth/qoauth2authorizationcodeflow.cpp
@@ -364,7 +364,7 @@ void QOAuth2AuthorizationCodeFlow::setAccessTokenUrl(const QUrl &accessTokenUrl)
\sa pkceMethod(), QOAuth2AuthorizationCodeFlow::PkceMethod
*/
-void QOAuth2AuthorizationCodeFlow::setPkceMethod(PkceMethod method, quint8 length)
+void QOAuth2AuthorizationCodeFlow::setPkceMethod(PkceMethod method, qsizetype length)
{
Q_D(QOAuth2AuthorizationCodeFlow);
if (length < 43 || length > 128) {
@@ -372,7 +372,8 @@ void QOAuth2AuthorizationCodeFlow::setPkceMethod(PkceMethod method, quint8 lengt
qWarning("Invalid PKCE length provided, must be between 43..128. Ignoring.");
return;
}
- d->pkceVerifierLength = length;
+ static_assert(std::is_same_v<decltype(d->pkceVerifierLength), quint8>);
+ d->pkceVerifierLength = quint8(length);
d->pkceMethod = method;
}