diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-06-01 16:57:14 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-06-01 23:00:26 +0200 |
commit | eebd84b337506c8fff151493f9b51bd127dbc89f (patch) | |
tree | 45284084864d587e245d6f5eaa1b19b546ec1dd5 /svl | |
parent | 1193c331945481dd155a55c6695ff6fd88bd3d10 (diff) |
loplugin:stringview (clang-cl)
Change-Id: Id1f8f24fec638efcdf5a04ca7253e6f401afd2fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116548
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/crypto/cryptosign.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index 6177dbb9d29c..b99dab35bf62 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <sal/config.h> + +#include <string_view> + #include <svl/cryptosign.hxx> #include <svl/sigstruct.hxx> #include <config_crypto.h> @@ -2131,9 +2135,9 @@ bool Signing::Verify(const std::vector<unsigned char>& aData, return false; } auto pDigestID = reinterpret_cast<CRYPT_ALGORITHM_IDENTIFIER*>(pDigestBytes.get()); - if (OString(szOID_NIST_sha256) == pDigestID->pszObjId) + if (std::string_view(szOID_NIST_sha256) == pDigestID->pszObjId) rInformation.nDigestID = xml::crypto::DigestID::SHA256; - else if (OString(szOID_RSA_SHA1RSA) == pDigestID->pszObjId || OString(szOID_OIWSEC_sha1) == pDigestID->pszObjId) + else if (std::string_view(szOID_RSA_SHA1RSA) == pDigestID->pszObjId || std::string_view(szOID_OIWSEC_sha1) == pDigestID->pszObjId) rInformation.nDigestID = xml::crypto::DigestID::SHA1; else // Don't error out here, we can still verify the message digest correctly, just the digest ID won't be set. @@ -2239,7 +2243,7 @@ bool Signing::Verify(const std::vector<unsigned char>& aData, * { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) * smime(16) id-aa(2) 47 } */ - if (OString("1.2.840.113549.1.9.16.2.47") == rAttr.pszObjId) + if (std::string_view("1.2.840.113549.1.9.16.2.47") == rAttr.pszObjId) { rInformation.bHasSigningCertificate = true; break; @@ -2262,7 +2266,7 @@ bool Signing::Verify(const std::vector<unsigned char>& aData, { CRYPT_ATTRIBUTE& rAttr = pSignedAttributes->rgAttr[nAttr]; // Timestamp blob - if (OString("1.2.840.113549.1.9.16.2.14") == rAttr.pszObjId) + if (std::string_view("1.2.840.113549.1.9.16.2.14") == rAttr.pszObjId) { PCRYPT_TIMESTAMP_CONTEXT pTsContext; if (!CryptVerifyTimeStampSignature(rAttr.rgValue->pbData, rAttr.rgValue->cbData, nullptr, 0, nullptr, &pTsContext, nullptr, nullptr)) |