Commit Graph

47 Commits

Author SHA1 Message Date
Davide Beatrici
1ac534915c Remove remaining Qt 4 stuff
For reference: https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5
2019-10-10 03:14:38 +02:00
Davide Beatrici
15831dbca8 Add missing includes for "no-pch" build
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>").
2019-09-12 22:08:39 +02:00
Davide Beatrici
5a07244a44 Don't include PCH headers directly
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."
2019-09-12 00:13:35 +02:00
Tasos Sahanidis
501d7c7350
Use QSslSocket for Ca Certs on Qt5 < 5.5
Fixes regression caused by 3cd2984e8a
2019-08-15 18:13:00 +03:00
Davide Beatrici
3cd2984e8a SSL.cpp: replace deprecated QSslSocket::systemCaCertificates() with QSslConfiguration::systemCaCertificates()
92cda94742
2019-07-28 00:15:12 +02:00
Alexis Jeandeau
5af3145855 Add support for TLS 1.3 in the server information window 2019-04-07 12:13:48 +09:00
Davide Beatrici
b427333257 Auto-update LICENSE.header in source files 2019-01-25 04:56:19 +01:00
Kevin Zheng
a78cff3dc5 Fix build with OpenSSL 1.1.1a
OpenSSL 1.1.1a replaces the CRYPTO_get_locking_callback() function with
a macro definition to (NULL).
2018-12-30 23:54:58 -06:00
Mikkel Krautz
f6ba3a52bf Auto-update LICENSE.header in source files. 2018-01-01 23:05:37 +01:00
Mikkel Krautz
72e0a78272 SSL: register OpenSSL threading callbacks when we can't access Qt's OpenSSL.
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.
2017-07-17 10:19:13 +02:00
Mikkel Krautz
f041bdbde1 SSL: add destroy() function to the SSL module.
This is in preparation for adding proper OpenSSL multithreaded locking
for when we use our own copy of OpenSSL instead of Qt's.
2017-07-17 09:49:40 +02:00
Mikkel Krautz
f544524d4c SSL: remove qsslSanityCheck.
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.
2017-06-01 00:23:35 +02:00
Mikkel Krautz
dff15577d6 SSL: also initialize Mumble's copy of libssl/libcrypto.
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.
2017-06-01 00:05:27 +02:00
Mikkel Krautz
91ebb8b0b5 Update tree copyrights to 2017. 2017-01-08 21:05:57 +01:00
Mikkel Krautz
4aa902ded3 MumbleSSL: add a sanity check for QSsl loading a different version of OpenSSL than we're linked against. 2016-05-22 01:52:40 +02:00
Mikkel Krautz
395c084b7a src: update to use LICENSE.header. 2016-05-10 22:42:02 +02:00
Mikkel Krautz
0840dd4578 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 mumble-voip/mumble#1876
2016-02-17 01:22:47 +01:00
Mikkel Krautz
ed308af89b SSL: add const_cast to be compatible with OpenSSL 0.9.8. 2015-11-28 17:39:13 +01:00
Stefan Hacker
51ab40a475 Fix warning due to missing default case in protocolToString
Fixes #1848
2015-10-25 19:56:45 +01:00
Stefan Hacker
e8027bd664 Output more control channel encryption parameters
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.
2015-10-04 12:29:12 +02:00
Mikkel Krautz
8bd3f76a8e Murmur: add support for EDH cipher suites, and for specifying Diffie-Hellman parmeters.
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.
2015-09-26 22:33:49 +02:00
Stefan Hacker
c84916f908 SSL: Fix build for Qt 5 versions before Qt 5.3
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.
2015-06-05 04:08:45 +02:00
Mikkel Krautz
3283ac2fdd SSL: fix build for Qt 4. 2015-06-05 02:04:20 +02:00
Mikkel Krautz
e5ddf5566a SSL: move declaration of 'i' in MumbleSSL::ciphersFromOpenSSLCipherString() to the top of the function.
Again, something the MSVC allowed, but is obviously wrong.
2015-05-22 21:00:57 +02:00
Mikkel Krautz
49f57d3da5 SSL: add MumbleSSL::defaultOpenSSLCipherString().
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.
2015-05-22 18:24:26 +02:00
Mikkel Krautz
1dc6ecc519 SSL: implement OpenSSL cipher list format reader.
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.
2015-05-22 18:24:25 +02:00
Stefan Hacker
12eb26431f Replace all uses of QT_VERSION_CHECK with explicit version.
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
2014-08-22 01:55:34 +02:00
Mikkel Krautz
434087c30d SSL: make CA filter code compatible with Qt 5. 2014-07-25 16:53:00 +02:00
Mikkel Krautz
7141a05c0e Add CA certificate filter to MumbleSSL::addSystemCA() to work around issue 1271. 2014-06-13 00:46:38 +02:00
Benjamin Jemlich
d16876d804 Fix certificate validation with QT 4.8
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>
2012-02-19 09:03:47 +01:00
Benjamin Jemlich
2d9d78ad68 Remove hardcoded CA certificates 2012-02-18 10:41:22 +01:00
Benjamin Jemlich
07737a314c Fix include guards and PCH includes 2011-11-09 00:12:10 +01:00
Benjamin Jemlich
7529297760 Fix uppercase vs lowercase vs PCH include problems 2011-05-15 17:15:54 +02:00
Ludwig Nussel
e57c008220 fix compile error
/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
2011-03-24 20:09:22 +01:00
Thorvald Natvig
f3437a6ba7 Update copyright year ranges of dev team. 2011-03-18 05:52:51 +01:00
Benjamin Jemlich
63b84d3f9a Disable system CA override in Qt 4.7 2010-07-17 22:28:08 +02:00
Jamie Fraser
9c9983bf23 Added default root certificate store on FreeBSD. 2010-07-14 15:15:19 +02:00
Thorvald Natvig
778ecdea43 Indent, changelog, submodule and language update 2010-05-31 00:17:36 +02:00
Thorvald Natvig
a8268d7f77 Add recommended user CAs explicitly 2010-05-27 16:22:55 +02:00
Thorvald Natvig
16339bfc91 Update license to 2010 2010-01-05 08:49:22 +01:00
Ludwig Nussel
317a2bfb37 add support for certificate directories
SUSE uses /etc/ssl/certs for system certificates
2009-11-07 16:26:30 +01:00
Thorvald Natvig
be58259c78 Allow murmurd to compile under Qt 4.4.3 2009-10-20 18:12:22 +02:00
Mikkel Krautz
df9b900efd Use system CA certificates on OS X. 2009-08-11 18:58:52 +02:00
Thorvald Natvig
38b6ec947e Indent, changelog and submodule update 2009-08-08 16:14:08 +02:00
Thorvald Natvig
5b3c901fdd Allow specifying SYSTEM_CA_BUNDLE define to force CA path 2009-08-07 20:33:08 +02:00
Thorvald Natvig
6296282539 Share a bit more of .pro files, and add win32 ca store 2009-08-07 20:16:02 +02:00
Thorvald Natvig
8159eecdcb Add system-installed CAs 2009-08-07 18:55:56 +02:00