Skip to content
Permalink
Browse files

Fix OpenSSL intialization.

Add a MumbleSSL::initialize() method and call it
in Mumble's and Murmur's main functions, just before
construction of QApplication.

This ensures OpenSSL is initialized before we use it.

Our new cipher suite selection support apparently broke
Mumble and Murmur on Linux, at least for some systems.

This commit remedies that by ensuring that we initialize
OpenSSL early.

For Debian's patch, see
http://sources.debian.net/patches/patch/mumble/1.2.12-1/43-initialize-SSL.diff/

Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804363
Fixes #1876
  • Loading branch information...
mkrautz committed Feb 16, 2016
1 parent d1b958a commit 0840dd4578029c93810cc0369b4bd23188647916
Showing with 21 additions and 1 deletion.
  1. +5 −0 src/SSL.cpp
  2. +1 −0 src/SSL.h
  3. +9 −1 src/mumble/ServerHandler.cpp
  4. +3 −0 src/mumble/main.cpp
  5. +3 −0 src/murmur/main.cpp
@@ -34,6 +34,11 @@

#include "Version.h"

void MumbleSSL::initialize() {
// Let Qt initialize OpenSSL...
QSslSocket::supportsSsl();
}

QString MumbleSSL::defaultOpenSSLCipherString() {
return QLatin1String("EECDH+AESGCM:EDH+aRSA+AESGCM:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:AES256-SHA:AES128-SHA");
}
@@ -37,6 +37,7 @@

class MumbleSSL {
public:
static void initialize();
static QString defaultOpenSSLCipherString();
static QList<QSslCipher> ciphersFromOpenSSLCipherString(QString cipherString);
static void addSystemCA();
@@ -95,7 +95,15 @@ ServerHandler::ServerHandler() {
tConnectionTimeoutTimer = NULL;
uiVersion = 0;

// For some strange reason, on Win32, we have to call supportsSsl before the cipher list is ready.
// Historically, the qWarning line below initialized OpenSSL for us.
// It used to have this comment:
//
// "For some strange reason, on Win32, we have to call
// supportsSsl before the cipher list is ready."
//
// Now, OpenSSL is initialized in main() via MumbleSSL::initialize(),
// but since it's handy to have the OpenSSL version available, we
// keep this one around as well.
qWarning("OpenSSL Support: %d (%s)", QSslSocket::supportsSsl(), SSLeay_version(SSLEAY_VERSION));

MumbleSSL::addSystemCA();
@@ -55,6 +55,7 @@
#include "NetworkConfig.h"
#include "CrashReporter.h"
#include "SocketRPC.h"
#include "SSL.h"
#include "MumbleApplication.h"
#include "ApplicationPalette.h"
#include "Themes.h"
@@ -113,6 +114,8 @@ int main(int argc, char **argv) {
a.installNativeEventFilter(&a);
#endif

MumbleSSL::initialize();

#ifdef USE_SBCELT
{
QDir d(a.applicationVersionRootPath());
@@ -183,6 +183,7 @@ int main(int argc, char **argv) {
}

SetDllDirectory(L"");

#endif
int res;

@@ -212,6 +213,8 @@ int main(int argc, char **argv) {
a.setOrganizationName("Mumble");
a.setOrganizationDomain("mumble.sourceforge.net");

MumbleSSL::initialize();

QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
#if QT_VERSION < 0x050000
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));

0 comments on commit 0840dd4

Please sign in to comment.
You can’t perform that action at this time.