]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
tidy
authorCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Fri, 28 Jun 2024 08:52:01 +0000 (10:52 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 9 Jul 2024 09:15:16 +0000 (11:15 +0200)
(cherry picked from commit 3b66414c2abe313ed1ebc9e1faf373f637c47466)

pdns/dnsdistdist/test-dnsdisttcp_cc.cc
pdns/libssl.cc
pdns/libssl.hh
pdns/tcpiohandler.cc

index 22a27c692c1a07c021710046547bfda7572d785f..ff5d156a6e4c8e49da900ca57897698f3b29bcf2 100644 (file)
@@ -45,6 +45,7 @@ GlobalStateHolder<servers_t> 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>& dnsCryptQuery, time_t now, bool tcp)
 {
index ef57c87d2a6791edd6a5932b01142f3cccfedbb6..e4fafe244a32502eca11371991a4451cb33bbc2d 100644 (file)
@@ -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<const char*>(d_name), TLS_TICKETS_KEY_NAME_SIZE);
   result.append(reinterpret_cast<const char*>(d_cipherKey), TLS_TICKETS_CIPHER_KEY_SIZE);
   result.append(reinterpret_cast<const char*>(d_hmacKey), TLS_TICKETS_MAC_KEY_SIZE);
+  // NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast)
 
   return result;
 }
index c1ed2067407e7f56498fbb66f62d33417b4e547f..9bcf460802de04022f34b4fc71de8018f6891860 100644 (file)
@@ -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;
index 1fb91ef5e0ab7b060ef29bd6268faedae5a89ee4..094a3e8baa9555e6bd39265b6ebc58fb6aa98130 100644 (file)
@@ -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<const char*>(d_key.data), d_key.size);
     }
     return result;