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: rec-5.2.0-alpha1~32^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14764%2Fhead;p=thirdparty%2Fpdns.git fix Remi's comments and some formatting --- diff --git a/pdns/dnsdistdist/dnsdist-lua.cc b/pdns/dnsdistdist/dnsdist-lua.cc index 0bb509aa04..43adf2066c 100644 --- a/pdns/dnsdistdist/dnsdist-lua.cc +++ b/pdns/dnsdistdist/dnsdist-lua.cc @@ -3002,14 +3002,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) { @@ -3018,7 +3018,6 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) } }); - luaCtx.registerFunction::*)(const LuaArray>&)>("setResponsesMap", [](const std::shared_ptr& frontend, const LuaArray>& map) { if (frontend != nullptr) { auto newMap = std::make_shared>>(); diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index 4bdd9e32c8..48d193ac5b 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -2363,7 +2363,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. @@ -2548,7 +2548,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 db07add7be..cb9d480919 100644 --- a/pdns/tcpiohandler.cc +++ b/pdns/tcpiohandler.cc @@ -1038,9 +1038,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)