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."
This commit ensures that we only add the email subject alt name (SAN) if the passed-in
email is non-empty.
It turns out that the call to X509V3_EXT_conf_nid() in add_ext() will fail
if the SAN value is formatted incorrectly. In our case, we passed "email:"
as the value, and X509V3_EXT_conf_nid() would return NULL.
To fix this, we now check whether the email we've been given is empty or not.
If it's empty, we don't add the SAN. If it's there, we do.
Previously, the generator was choosing the certificate type (server or client) basing on the presence of the name and email, which is not ideal.
Fixes#3284.
Apparently, the GCC used on the CentOS 5/Ermine builder treats this as
a fatal error when warnings-as-errors is turned on.
Oddly enough, none of the others do.
This moves the refactored certificate generation code from
src/murmur/Cert.cpp into its own file, src/SelfSignedCertificate.cpp.
Furthermore, the code is refactored to also be able to fulfil the duties
of Mumble's code for generating self-signed certificates.
The old code in both Mumble and Murmur is updated to call the new
SelfSignedCertificate methods for generating client and server
certificates.
This fixes the ability to build Mumble with OpenSSL 1.1.
(Previously, only Murmur could be built.)