This commit adds all the missing includes when the PCH header is not used.
Also, some includes are reordered and/or made consistent (e.g. "#include <QtEndian>" -> "#include <QtCore/QtEndian>").
According to Qt's documentation the PCH header doesn't need to be included.
From https://doc.qt.io/qt-5/qmake-precompiledheaders.html:
"To make your project use precompiled headers, you only need to define the PRECOMPILED_HEADER variable in your project file."
"qmake will handle the rest, to ensure the creation and use of the precompiled header file. You do not need to include the precompiled header file in HEADERS, as qmake will do this if the configuration supports precompiled headers."
We neglected to register our own callbacks for locking and thread IDs
when we removed the restriction that we only allow one copy of OpenSSL
in the address space. (f544524d4c)
This commit remedies that by providing our own set of callbacks for
locking and getting thread IDs to OpenSSL.
Previously, we just expected that Qt would properly initialize OpenSSL.
However, when Qt and us use separate copies of OpenSSL -- we have to do
it ourselves.
Many distros are now shipping OpenSSL 1.1.
However, Qt 5 only supports OpenSSL 1.0 at present.
A Qt Project changeset implementing OpenSSL 1.1 support
is currently slated for Qt 5.10.
This leaves us in a situation where we're inevitably going
to be in situation where Mumble and Qt will be forced to use
different versions of OpenSSL on most Linux systems.
The previous commit in this PR has added proper initialization
to Mumble's copy of OpenSSL, instead of relying on Qt's only
initialization, which only works if Mumble and Qt are using the same
copy. This should fix the crashes people have reported when trying to
use Mumble/Murmur in a configuration where Mumble and Qt each use
their own copy of OpenSSL.
I'm still wary of allowing this, but it seems like the cleanest
approach.
An alternative would be to have Mumble/Murmur to try and
dynamically look up the symbols they need to run. However, we don't
really have the proper infrastructure to suport runtime-loaded
dependencies on Unix-like systems. Nor is it something we've done
in the past. Also, using OpenSSL 1.1 headers against OpenSSL 1.0
might also prove problematic anyway.
Instead of only relying on Qt to initialize its copy of
OpenSSL, ensure Mumble also initializes its copy.
This is obviously only relevant if Mumble links against one
copy, and Qt dlopens another copy.
As mentioned in #1811 we previously only output the
encryption algorithm as well as the width of the key
in the server information dialog.
This patch adds the encryption protocol, authentication
method and key-exchange method to the dialog. The
wording is similar to what Chrome uses to make it easier
to google.
As the option to retrieve the actual encryption protocol
for the connection was only added in Qt 5.4 we output
"TLS" in clients built with earlier versions as we cannot
know which version we are actually using.
Due to limitations in the information Qt provides us the
current output is far from ideal. To fix that additional
work is requored which will be done in a followup patch.
This change allows server admins to specify Diffie-Hellman
parameters for Murmur to use. This is done using the sslDHParams
option in the config file. Diffie-Hellman parameters can also be
set on a per-server basis using the sslDHParams option.
Note: the functionality implemented in this change requires the
QSslDiffieHellmanParameters class in Qt, which has not yet landed
upstream in the Qt 5 'dev' branch. This means that the functionality
discussed in this change will, for now, only work in binaries provided
by the Mumble project, or binaries that are built using our build
environments, and not binaries that link against any released versions
of Qt at present.
This change modifies the default TLS cipher suite string to add
EDH+aRSA+AESGCM, DHE-RSA-AES256-SHA and DHE-RSA-AES128-SHA.
This yields the following ciphers, in TLS/RFC notation:
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
This change also allows Murmur servers to provide forward secrecy
to older clients, such as our own pre-built binaries before 1.2.9.
It also provides forward secrecy for users that use Mumble 1.2.x
versions on Linux distros, and other Unix-like systems. This is
because Mumble 1.2.x on Unix-like systems builds against Qt 4, which
limits the connection to TLS 1.0.
Before this change, Murmur was not able to negotiate an ephemeral
Diffie-Hellman key exchange for those clients. This is now possible.
Applies the Qt 4 workaround in 3283ac2fdd
also to Qt versions before 5.3 as those have the same API restrictions
on the QSslChiper constructor. Unfortunately the Qt documentation
doesn't have the usual note about it having been added later which
made this slip through. This should fix our builds on trusty.
This commit adds a new method to MumbleSSL that returns Mumble's
preferred cipher suites represented in the OpenSSL cipher list format.
This commit does not hook up the function to anything. It merely
implements it.
Previously, Mumble relied on OpenSSL's default cipher suites. However,
that decision has increasingly turned out to be unwise. Often, new TLS
vulnerabilities require server admins and users to be able to change the
cipher suites advertised by their software to help mitigate the damage.
This was not previously possible in Mumble.
The other thing that prompted this change is the Logjam TLS vulnerablity
(https://weakdh.org/, CVE-2015-4000). Mumble is not vulnerable to Logjam,
because Mumble has never allowed export grade DH groups. However, one of
the other key takeaways from the Logjam paper, "Imperfect Forward Secrecy:
How Diffie-Hellman Fails in Practice", is that the Internet community
should move towards DH groups bigger than 1024 bits, and preferably use
unique groups on a per-server basis. Unfortunately, neither of these two
solutions are possible with API that Qt provides for TLS.
To remedy this, we instead drop support for non-Elliptic Curve DH
in the default cipher configuration. We don't have any legacy clients
to support that can only use DH, so this is fine.
The OpenSSL cipher list in MumbleSSL::defaultOpenSSLCipherString()
evaluates to the following set of cipher suites, in order of preference:
ECDHE-RSA-AES256-GCM-SHA384 (TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384)
ECDHE-ECDSA-AES256-GCM-SHA384 (TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384)
ECDHE-RSA-AES128-GCM-SHA256 (TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256)
ECDHE-ECDSA-AES128-GCM-SHA256 (TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256)
AES256-SHA (TLS_RSA_WITH_AES_256_CBC_SHA)
AES128-SHA (TLS_RSA_WITH_AES_128_CBC_SHA)
The CBC-mode cipher suites are included for backwards compatibility with
older 1.2.x Mumble clients and other implementations that only use
TLSv1.0.
This commit implements MumbleSSL::ciphersFromOpenSSLCipherString(),
which reads a string in OpenSSL's cipher list format and returns a list
of QSslCiphers for use with QSsl.
This function will be used for implementing user-configurable cipher
suites in Mumble and Murmur.
This commit also changes our precompiled headers slightly by rearranging
the OpenSSL includes. This is done because the ssl.h header on Windows
requires winsock2.h (and perhaps others). By moving the includes, we
ensure that winsock2.h is included.
Qt4's moc is not able to expand QT_VERSION_CHECK which may lead
to invalid codegen when used for backwards compatibility work.
Replaced all occurances with explicit check against numeric
version which are treated correctly. Even though bad interactions
might be rare we should no longer use this macro as long as we
want to compile with Qt 4. Also see:
http://lists.qt-project.org/pipermail/interest/2013-August/008351.html
Changed from setDefaultCaCertificates to addDefaultCaCertificates because
Murmur adds CA certificates in sslCert before calling MumbleSSL::addSystemCA.
Original patch written by Marc Deslauriers <marc.deslauriers@canonical.com>
/usr/include/QtCore/qstring.h: In static member function 'static void MumbleSSL::addSystemCA()':
/usr/include/QtCore/qstring.h:588:5: error: 'QString::QString(const char*)' is private