Fix CVE-2021-34825 patch backport for 0.12.5

This commit is contained in:
phuzion 2021-06-22 11:54:19 -04:00
parent 83d9f52120
commit 397cbe5faf
2 changed files with 12 additions and 9 deletions

View File

@ -65,6 +65,7 @@ Quassel client
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%build
mkdir build

View File

@ -1,8 +1,7 @@
diff --git a/src/core/sslserver.cpp b/src/core/sslserver.cpp
index 9c3c7edc..1c1f05cd 100644
--- a/src/core/sslserver.cpp
+++ b/src/core/sslserver.cpp
@@ -49,6 +49,13 @@ SslServer::SslServer(QObject* parent)
diff -ruN a/src/core/sslserver.cpp b/src/core/sslserver.cpp
--- a/src/core/sslserver.cpp 2018-04-23 21:44:48.000000000 +0000
+++ b/src/core/sslserver.cpp 2021-06-22 04:27:39.596212479 +0000
@@ -52,6 +52,16 @@
// Initialize the certificates for first-time usage
if (!loadCerts()) {
@ -10,9 +9,12 @@ index 9c3c7edc..1c1f05cd 100644
+ // do not proceed, throw an exception and quit. This prevents the core from falling
+ // back to a plaintext-only core when they should be expecting SSL/TLS only.
+ if (Quassel::isOptionSet("require-ssl")) {
+ throw ExitException{EXIT_FAILURE, tr("--require-ssl is set, but no SSL certificate is available. Exiting.\n"
+ "Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.")};
+ quWarning()
+ << "--require-ssl is set, but no SSL certificate is available. "
+ << "Exiting.\nPlease see https://quassel-irc.org/faq/cert to learn"
+ << "how to enable SSL support.";
+ exit(EXIT_FAILURE);
+ }
if (!sslWarningShown) {
qWarning() << "SslServer: Unable to set certificate file\n"
<< " Quassel Core will still work, but cannot provide SSL for client connections.\n"
quWarning()
<< "SslServer: Unable to set certificate file\n"