From: Charles-Henri Bruyand Date: Thu, 10 Oct 2024 10:43:15 +0000 (+0200) Subject: fix Remi's comments and some formatting X-Git-Tag: dnsdist-1.9.8~4^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=10c0b27dbf87b9203e2680ddc86b784d38ef905c;p=thirdparty%2Fpdns.git fix Remi's comments and some formatting (cherry picked from commit c9177f2274ce98a4130d22e2dc47b6326d206086) --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 49c353c947..8f5b3bb826 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -3071,14 +3071,14 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) } try { #ifdef HAVE_DNS_OVER_TLS - if (frontend->tlsFrontend) { - frontend->tlsFrontend->loadTicketsKey(key); - } + if (frontend->tlsFrontend) { + frontend->tlsFrontend->loadTicketsKey(key); + } #endif /* HAVE_DNS_OVER_TLS */ #ifdef HAVE_DNS_OVER_HTTPS - if (frontend->dohFrontend) { - frontend->dohFrontend->loadTicketsKey(key); - } + if (frontend->dohFrontend) { + frontend->dohFrontend->loadTicketsKey(key); + } #endif /* HAVE_DNS_OVER_HTTPS */ } catch (const std::exception& e) { diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index 5f283e0348..c5fe0673bf 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -2259,7 +2259,7 @@ DOHFrontend .. method:: DOHFrontend:loadTicketsKey(key) - Replace the current TLS tickets key with a given one. + Load a new TLS tickets key. :param str key: the new raw TLS tickets key to load. @@ -2444,7 +2444,7 @@ TLSFrontend .. method:: TLSFrontend:loadTicketsKey(key) - Replace the current TLS tickets key with a given one. + Load a new TLS tickets key. :param str key: the new raw TLS tickets key to load. diff --git a/pdns/tcpiohandler.cc b/pdns/tcpiohandler.cc index 547aaa40b9..a437e45cc2 100644 --- a/pdns/tcpiohandler.cc +++ b/pdns/tcpiohandler.cc @@ -1047,9 +1047,6 @@ public: } catch (const std::exception& e) { - safe_memory_release(d_key.data, d_key.size); - gnutls_free(d_key.data); - d_key.data = nullptr; safe_memory_release(d_key.data, d_key.size); gnutls_free(d_key.data); d_key.data = nullptr; diff --git a/regression-tests.dnsdist/test_TLS.py b/regression-tests.dnsdist/test_TLS.py index f40c18cfe4..c54f3dee41 100644 --- a/regression-tests.dnsdist/test_TLS.py +++ b/regression-tests.dnsdist/test_TLS.py @@ -555,7 +555,6 @@ class TestOpenSSLTLSTicketsKeyCallback(DNSDistTest): """ newKey = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(80)) - print("about to send command: `{}`".format("getTLSFrontend(0):setTicketsKey(\"{}\")".format(newKey))) self.sendConsoleCommand("getTLSFrontend(0):loadTicketsKey(\"{}\")".format(newKey)) keyLen = self.sendConsoleCommand('lastKeyLen') self.assertEqual(int(keyLen), 80) @@ -597,7 +596,6 @@ class TestGnuTLSTLSTicketsKeyCallback(DNSDistTest): """ newKey = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(64)) - print("about to send command: `{}`".format("getTLSFrontend(0):setTicketsKey(\"{}\")".format(newKey))) self.sendConsoleCommand("getTLSFrontend(0):loadTicketsKey(\"{}\")".format(newKey)) keyLen = self.sendConsoleCommand('lastKeyLen') self.assertEqual(int(keyLen), 64)