From: Charles-Henri Bruyand Date: Fri, 28 Jun 2024 08:52:01 +0000 (+0200) Subject: tidy X-Git-Tag: dnsdist-1.9.6~2^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=451b12db416d399aeee8f3911cce3985bcf61e8c;p=thirdparty%2Fpdns.git tidy (cherry picked from commit 3b66414c2abe313ed1ebc9e1faf373f637c47466) --- diff --git a/pdns/dnsdistdist/test-dnsdisttcp_cc.cc b/pdns/dnsdistdist/test-dnsdisttcp_cc.cc index 22a27c692c..ff5d156a6e 100644 --- a/pdns/dnsdistdist/test-dnsdisttcp_cc.cc +++ b/pdns/dnsdistdist/test-dnsdisttcp_cc.cc @@ -45,6 +45,7 @@ GlobalStateHolder g_dstates; QueryCount g_qcount; const bool TCPIOHandler::s_disableConnectForUnitTests = true; +dnsdist_tickets_key_added_hook TLSCtx::s_ticketsKeyAddedHook{nullptr}; bool checkDNSCryptQuery(const ClientState& cs, PacketBuffer& query, std::unique_ptr& dnsCryptQuery, time_t now, bool tcp) { diff --git a/pdns/libssl.cc b/pdns/libssl.cc index ef57c87d2a..e4fafe244a 100644 --- a/pdns/libssl.cc +++ b/pdns/libssl.cc @@ -747,9 +747,11 @@ std::string OpenSSLTLSTicketKey::content() const { std::string result{}; result.reserve(TLS_TICKETS_KEY_NAME_SIZE + TLS_TICKETS_CIPHER_KEY_SIZE + TLS_TICKETS_MAC_KEY_SIZE); + // NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast) result.append(reinterpret_cast(d_name), TLS_TICKETS_KEY_NAME_SIZE); result.append(reinterpret_cast(d_cipherKey), TLS_TICKETS_CIPHER_KEY_SIZE); result.append(reinterpret_cast(d_hmacKey), TLS_TICKETS_MAC_KEY_SIZE); + // NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast) return result; } diff --git a/pdns/libssl.hh b/pdns/libssl.hh index c1ed206740..9bcf460802 100644 --- a/pdns/libssl.hh +++ b/pdns/libssl.hh @@ -100,7 +100,7 @@ public: #if OPENSSL_VERSION_MAJOR >= 3 int encrypt(unsigned char keyName[TLS_TICKETS_KEY_NAME_SIZE], unsigned char* iv, EVP_CIPHER_CTX* ectx, EVP_MAC_CTX* hctx) const; bool decrypt(const unsigned char* iv, EVP_CIPHER_CTX* ectx, EVP_MAC_CTX* hctx) const; - std::string content() const; + [[nodiscard]] std::string content() const; #else int encrypt(unsigned char keyName[TLS_TICKETS_KEY_NAME_SIZE], unsigned char* iv, EVP_CIPHER_CTX* ectx, HMAC_CTX* hctx) const; bool decrypt(const unsigned char* iv, EVP_CIPHER_CTX* ectx, HMAC_CTX* hctx) const; diff --git a/pdns/tcpiohandler.cc b/pdns/tcpiohandler.cc index 1fb91ef5e0..094a3e8baa 100644 --- a/pdns/tcpiohandler.cc +++ b/pdns/tcpiohandler.cc @@ -988,10 +988,11 @@ public: throw; } } - std::string content() const + [[nodiscard]] std::string content() const { std::string result{}; if (d_key.data != nullptr && d_key.size > 0) { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) result.append(reinterpret_cast(d_key.data), d_key.size); } return result;