From: Charles-Henri Bruyand Date: Fri, 28 Jun 2024 08:52:01 +0000 (+0200) Subject: tidy X-Git-Tag: rec-5.2.0-alpha1~198^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b66414c2abe313ed1ebc9e1faf373f637c47466;p=thirdparty%2Fpdns.git tidy --- diff --git a/pdns/dnsdistdist/test-dnsdisttcp_cc.cc b/pdns/dnsdistdist/test-dnsdisttcp_cc.cc index 2934616ff7..fc397a68ad 100644 --- a/pdns/dnsdistdist/test-dnsdisttcp_cc.cc +++ b/pdns/dnsdistdist/test-dnsdisttcp_cc.cc @@ -40,6 +40,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 cd9ad076fe..4a2299a37a 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;