]> 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)
committerCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Wed, 3 Jul 2024 07:10:49 +0000 (09:10 +0200)
pdns/dnsdistdist/test-dnsdisttcp_cc.cc
pdns/libssl.cc
pdns/libssl.hh
pdns/tcpiohandler.cc

index 2934616ff769dec7272fa9ba599c4b5159e46109..fc397a68ad231c37a19e3cbf9ef7f4b3d8b6c791 100644 (file)
@@ -40,6 +40,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 cd9ad076fe947809b792ecce66621cfcabad9aef..4a2299a37a16806f682a9f166fce5599609a7f13 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;