diff --git a/plugins/qca-botan/qca-botan.cpp b/plugins/qca-botan/qca-botan.cpp index cb4af978..d2ec84fb 100644 --- a/plugins/qca-botan/qca-botan.cpp +++ b/plugins/qca-botan/qca-botan.cpp @@ -436,6 +436,12 @@ static void qcaCipherToBotanCipher(const QString &type, std::string *algoName, s } } +static std::string qcaCipherToBotanCipher(const QString &qcaCipher) { + std::string algoName, algoMode, algoPadding; + qcaCipherToBotanCipher(qcaCipher, &algoName, &algoMode, &algoPadding); + return algoName+'/'+algoMode+'/'+algoPadding; // NOLINT(performance-inefficient-string-concatenation) +} + //----------------------------------------------------------- class BotanCipherContext : public QCA::CipherContext { @@ -648,11 +654,10 @@ public: list += QStringLiteral("blowfish-ofb"); for (const QString &cipher : qAsConst(list)) { - std::string algoName, algoMode, algoPadding; - qcaCipherToBotanCipher(cipher, &algoName, &algoMode, &algoPadding); + const std::string bothanCipher = qcaCipherToBotanCipher(cipher); try { - std::unique_ptr enc(Botan::get_cipher(algoName+'/'+algoMode+'/'+algoPadding, Botan::ENCRYPTION)); // NOLINT(performance-inefficient-string-concatenation) - std::unique_ptr dec(Botan::get_cipher(algoName+'/'+algoMode+'/'+algoPadding, Botan::DECRYPTION)); // NOLINT(performance-inefficient-string-concatenation) + std::unique_ptr enc(Botan::get_cipher(bothanCipher, Botan::ENCRYPTION)); + std::unique_ptr dec(Botan::get_cipher(bothanCipher, Botan::DECRYPTION)); supported += cipher; } catch (Botan::Exception& e) { } diff --git a/src/qca_cert.cpp b/src/qca_cert.cpp index 5e73d989..bcdc6b71 100644 --- a/src/qca_cert.cpp +++ b/src/qca_cert.cpp @@ -2021,7 +2021,9 @@ CRLEntry::CRLEntry(const Certificate &c, Reason r) _reason = r; } -CRLEntry::CRLEntry(const BigInteger serial, const QDateTime &time, Reason r) // clazy:exclude=function-args-by-ref NOLINT(performance-unnecessary-value-param) TODO make serial const & when we break ABI +// TODO make serial const & when we break ABI +CRLEntry::CRLEntry(const BigInteger serial, // clazy:exclude=function-args-by-ref NOLINT(performance-unnecessary-value-param) + const QDateTime &time, Reason r) { _serial = serial; _time = time; diff --git a/unittest/certunittest/certunittest.cpp b/unittest/certunittest/certunittest.cpp index 5df8243e..34aa77e4 100644 --- a/unittest/certunittest/certunittest.cpp +++ b/unittest/certunittest/certunittest.cpp @@ -81,7 +81,8 @@ void CertUnitTest::nullCert() else { QCA::Certificate nullCert; QVERIFY(nullCert.isNull()); - QCA::Certificate anotherNullCert = nullCert; // NOLINT(performance-unnecessary-copy-initialization) This is copied on purpose to check the assignment operator + // This is copied on purpose to check the assignment operator + QCA::Certificate anotherNullCert = nullCert; // NOLINT(performance-unnecessary-copy-initialization) QVERIFY( anotherNullCert.isNull() ); QCOMPARE( nullCert, anotherNullCert ); } @@ -1114,7 +1115,8 @@ void CertUnitTest::csr() else { QCA::CertificateRequest nullCSR; QVERIFY( nullCSR.isNull() ); - QCA::CertificateRequest anotherNullCSR = nullCSR; // NOLINT(performance-unnecessary-copy-initialization) This is copied on purpose to check the assignment operator + // This is copied on purpose to check the assignment operator + QCA::CertificateRequest anotherNullCSR = nullCSR; // NOLINT(performance-unnecessary-copy-initialization) QVERIFY( anotherNullCSR.isNull() ); QCOMPARE( nullCSR, anotherNullCSR); diff --git a/unittest/hexunittest/hexunittest.cpp b/unittest/hexunittest/hexunittest.cpp index f5588ea1..93b51d4e 100644 --- a/unittest/hexunittest/hexunittest.cpp +++ b/unittest/hexunittest/hexunittest.cpp @@ -64,7 +64,8 @@ void HexUnitTest::testHexString_data() QTest::newRow("ABCD") << QStringLiteral("ABCD") << QStringLiteral("41424344"); QTest::newRow("empty") << QString(QLatin1String("")) << QString(QLatin1String("")); QTest::newRow("abcddef") << QStringLiteral("abcddef") << QStringLiteral("61626364646566"); - QTest::newRow("empty too") << QString::fromLatin1("\0") << QString::fromLatin1(""); // Empty QString. clazy:exclude=qstring-allocations + QTest::newRow("empty too") << QString::fromLatin1("\0") // clazy:exclude=qstring-allocations + << QString::fromLatin1(""); // Empty QString. clazy:exclude=qstring-allocations QTest::newRow("BEL") << QStringLiteral("\a") << QStringLiteral("07"); // BEL QTest::newRow("BS") << QStringLiteral("\b") << QStringLiteral("08"); // BS QTest::newRow("HT") << QStringLiteral("\t") << QStringLiteral("09"); // HT