summaryrefslogtreecommitdiffstats
path: root/src/plugins/tls
diff options
context:
space:
mode:
authorAnton Kudryavtsev <anton.kudryavtsev@vk.team>2023-08-17 14:55:25 +0300
committerAnton Kudryavtsev <antkudr@mail.ru>2023-08-17 19:29:08 +0000
commit5dc068e95a212d0b9e55c6e0091b372507b0c80f (patch)
treeed16241b9bdd736e2833c4af75d13eb96558faa1 /src/plugins/tls
parent600d16df224da8476d9388c14a91d08863dcde90 (diff)
tls: use string view types more
Prefer QStringView overloads Change-Id: Icc928a91056d661f9e7f187f42592f05ad081a84 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/plugins/tls')
-rw-r--r--src/plugins/tls/openssl/qtls_openssl.cpp2
-rw-r--r--src/plugins/tls/schannel/qtls_schannel.cpp3
-rw-r--r--src/plugins/tls/shared/qasn1element.cpp4
3 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/tls/openssl/qtls_openssl.cpp b/src/plugins/tls/openssl/qtls_openssl.cpp
index 031ccd9d15..57d09a649b 100644
--- a/src/plugins/tls/openssl/qtls_openssl.cpp
+++ b/src/plugins/tls/openssl/qtls_openssl.cpp
@@ -92,7 +92,7 @@ QSslCertificate findCertificateToFetch(const QList<QSslError> &tlsErrors, bool c
if (checkAIA) {
const auto extensions = certToFetch.extensions();
for (const auto &ext : extensions) {
- if (ext.oid() == QStringLiteral("1.3.6.1.5.5.7.1.1")) // See RFC 4325
+ if (ext.oid() == u"1.3.6.1.5.5.7.1.1") // See RFC 4325
return certToFetch;
}
//The only reason we check this extensions is because an application set trusted
diff --git a/src/plugins/tls/schannel/qtls_schannel.cpp b/src/plugins/tls/schannel/qtls_schannel.cpp
index 9d171b5030..9f9316d571 100644
--- a/src/plugins/tls/schannel/qtls_schannel.cpp
+++ b/src/plugins/tls/schannel/qtls_schannel.cpp
@@ -805,8 +805,7 @@ bool netscapeWrongCertType(const QList<QSslCertificateExtension> &extensions, bo
const auto netscapeIt = std::find_if(
extensions.cbegin(), extensions.cend(),
[](const QSslCertificateExtension &extension) {
- const auto netscapeCertType = QStringLiteral("2.16.840.1.113730.1.1");
- return extension.oid() == netscapeCertType;
+ return extension.oid() == u"2.16.840.1.113730.1.1";
});
if (netscapeIt != extensions.cend()) {
const QByteArray netscapeCertTypeByte = netscapeIt->value().toByteArray();
diff --git a/src/plugins/tls/shared/qasn1element.cpp b/src/plugins/tls/shared/qasn1element.cpp
index 507a3a727a..63351947f0 100644
--- a/src/plugins/tls/shared/qasn1element.cpp
+++ b/src/plugins/tls/shared/qasn1element.cpp
@@ -225,7 +225,7 @@ QDateTime QAsn1Element::toDateTime() const
if (mType == UtcTimeType && mValue.size() == 13) {
result = QDateTime::fromString(QString::fromLatin1(mValue),
- QStringLiteral("yyMMddHHmmsst"));
+ u"yyMMddHHmmsst");
if (!result.isValid())
return result;
@@ -248,7 +248,7 @@ QDateTime QAsn1Element::toDateTime() const
Q_ASSERT(result.date().year() <= 2049);
} else if (mType == GeneralizedTimeType && mValue.size() == 15) {
result = QDateTime::fromString(QString::fromLatin1(mValue),
- QStringLiteral("yyyyMMddHHmmsst"));
+ u"yyyyMMddHHmmsst");
}
return result;