From eb90a3c53e07fb2d09399219dff7de2ce21c643d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 8 Sep 2023 17:57:50 +0100 Subject: Try to help users with outdated SSL module configs. --- src/modules/extra/m_ssl_gnutls.cpp | 8 ++++++++ src/modules/extra/m_ssl_mbedtls.cpp | 8 ++++++++ src/modules/extra/m_ssl_openssl.cpp | 8 ++++++++ 3 files changed, 24 insertions(+) (limited to 'src') diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index c663b656b..22e02afe4 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -1190,7 +1190,15 @@ public: { const auto& tag = ServerInstance->Config->ConfValue("gnutls"); if (status.initial || tag->getBool("onrehash", true)) + { + // Try to help people who have outdated configs. + for (const auto& field : {"cafile", "certfile", "crlfile", "dhfile", "hash", "keyfile", "mindhbits", "outrecsize", "priority", "requestclientcert", "strictpriority"}) + { + if (!tag->getString(field).empty()) + throw ModuleException(this, "TLS settings have moved from to . See " INSPIRCD_DOCS "modules/ssl_gnutls/#sslprofile for more information."); + } ReadProfiles(); + } } void OnModuleRehash(User* user, const std::string& param) override diff --git a/src/modules/extra/m_ssl_mbedtls.cpp b/src/modules/extra/m_ssl_mbedtls.cpp index 04fc427eb..9e72cb49c 100644 --- a/src/modules/extra/m_ssl_mbedtls.cpp +++ b/src/modules/extra/m_ssl_mbedtls.cpp @@ -991,7 +991,15 @@ public: { const auto& tag = ServerInstance->Config->ConfValue("mbedtls"); if (status.initial || tag->getBool("onrehash", true)) + { + // Try to help people who have outdated configs. + for (const auto& field : {"cafile", "certfile", "ciphersuites", "crlfile", "curves", "dhfile", "hash", "keyfile", "maxver", "mindhbits", "minver", "outrecsize", "requestclientcert"}) + { + if (!tag->getString(field).empty()) + throw ModuleException(this, "TLS settings have moved from to . See " INSPIRCD_DOCS "modules/ssl_mbedtls/#sslprofile for more information."); + } ReadProfiles(); + } } void OnModuleRehash(User* user, const std::string& param) override diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 948c1a3e9..9f7240583 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -1043,7 +1043,15 @@ public: { const auto& tag = ServerInstance->Config->ConfValue("openssl"); if (status.initial || tag->getBool("onrehash", true)) + { + // Try to help people who have outdated configs. + for (const auto& field : {"cafile", "certfile", "ciphers", "clientclearoptions", "clientsetoptions", "compression", "crlfile", "crlmode", "crlpath", "dhfile", "ecdhcurve", "hash", "keyfile", "renegotiation", "requestclientcert", "serverclearoptions", "serversetoptions", "tlsv1", "tlsv11", "tlsv12", "tlsv13"}) + { + if (!tag->getString(field).empty()) + throw ModuleException(this, "TLS settings have moved from to . See " INSPIRCD_DOCS "modules/ssl_openssl/#sslprofile for more information."); + } ReadProfiles(); + } } void OnModuleRehash(User* user, const std::string& param) override -- cgit v1.3.1-10-gc9f91