Commit Graph

6652 Commits

Author SHA1 Message Date
Mikkel Krautz
fd78d6431e Meta, UnixMurmur: implement live certificate reloading via the USR1 signal.
This moves the SSL loading code from MetaParams::read() into a separate
method, loadSSLSettings(). It also hooks up the SIGUSR1 signal handler
to reload SSL settings and apply the setings to each suitable virtual
server.

A follow-up commit will change MetaParams::read() to also use loadSSLSettings(),
however it was left out of this commit to aid in reviewability.
2017-03-02 01:56:35 +01:00
Mikkel Krautz
9ae2a7f59e Merge PR #2891: ServerDB: use PasswordGenerator class for generating initial SuperUser password. 2017-03-02 01:47:11 +01:00
Mikkel Krautz
218eb18b3a ServerDB: use PasswordGenerator class for generating initial SuperUser password.
This replaces our ad-hoc password generator in ServerDB for generating
the initial SuperUser password.

The original implementation had several problems, including use of a
non-cryptographically secure random number generator, as well as problems
with modulo bias.
2017-03-02 01:32:46 +01:00
Mikkel Krautz
b046d6f1b1 Merge PR #2890: PasswordGenerator: add new class for generating human-friendly passwords via CryptographicRandom. 2017-03-02 01:32:24 +01:00
Mikkel Krautz
a9e7ccfdf3 PasswordGenerator: add new class for generating human-friendly passwords via CryptographicRandom. 2017-03-02 01:06:43 +01:00
Mikkel Krautz
e848e5629a Merge PR #2895: TestCryptographicRandom: add QT_NO_OPENGL to fix 'make check' for win32-msvc builds. 2017-03-02 00:54:05 +01:00
Mikkel Krautz
fc878e04bf TestCryptographicRandom: add QT_NO_OPENGL to fix 'make check' for win32-msvc builds. 2017-03-02 00:31:28 +01:00
Mikkel Krautz
a58d708f1e Merge PR #2882: CryptographicRandom: new class for acquiring random data for cryptographic purposes. 2017-03-02 00:26:49 +01:00
Mikkel Krautz
aa25435a7b CryptographicRandom: new class for acquiring random data for cryptographic purposes.
The class implements an API similar to OpenBSD's arc4random:

 - A way to get a random uint32_t. (arc4random)
 - A way to get a random uint32_t with an upper bound. (arc4random_uniform)
 - A way to fill a buffer with random data. (arc4random_buf)
2017-03-01 23:29:07 +01:00
Mikkel Krautz
cae5d6d0ec Merge PR #2885: .gitignore: add target_wrapper.bat. 2017-02-28 13:45:17 +01:00
Jan Klass
05f3fa9c6d Merge pull request #2887: Add Qt 5 Trusty build to .travis.yml. 2017-02-28 13:35:22 +01:00
Jan Klass
00f4762002 Merge pull request #2888: Cert: require Qt 5.5 for QSsl::Ec. 2017-02-28 13:11:14 +01:00
Mikkel Krautz
5a785f9ecd Merge PR #2889: Transifex translation update 2017-02-28 02:47:03 +01:00
MumbleTransifexBot
bd018a0fd2 Transifex translation update
Mode: default
Minimum percent translated: 0
Matched 42 languages
2017-02-28 01:27:39 +00:00
Mikkel Krautz
28d5b8e3fe Cert: require Qt 5.5 for QSsl::Ec.
It was not implemented until Qt 5.5:
962ea5690c

No trace in the Qt docs.
2017-02-28 02:04:24 +01:00
Mikkel Krautz
629dd2d889 Add Qt 5 Trusty build to .travis.yml. 2017-02-28 01:52:11 +01:00
Mikkel Krautz
9ff780b5e5 Merge PR #2886: src/tests: fix various MSVC build issues. 2017-02-28 01:18:20 +01:00
Mikkel Krautz
d1454a194f qmake/openssl.pri: link against gdi32.dll. 2017-02-28 01:04:18 +01:00
Mikkel Krautz
cba18e97b2 src/tests: fix various MSVC build issues.
This makes 'jom check' pass on our win32-static buildenv with MSVC 2015.
2017-02-28 01:03:56 +01:00
Mikkel Krautz
6070c8206a Merge PR #2883: ManualPlugin: re-enable unhinge button for Qt 5. 2017-02-28 00:32:15 +01:00
Mikkel Krautz
360477e61a .gitignore: add target_wrapper.bat.
This adds Qt's auto-generated test-runner-wrapper target_wrapper.bat
to gitignore.
2017-02-28 00:14:43 +01:00
Mikkel Krautz
d6751e8c64 ManualPlugin: re-enable unhinge button for Qt 5.
Unhinging works OK now, after we've migrated the plugin
to live inside Mumble.

Fixes mumble-voip/mumble#2456
2017-02-28 00:10:20 +01:00
Mikkel Krautz
0be68559e3 Merge PR #2881: tests: add existing TestCrypt, TestPacketDataStream and TestTimer tests to the test suite. 2017-02-27 00:14:20 +01:00
Mikkel Krautz
05c79d5095 tests: move TestTimer to new testing infrastructure. 2017-02-26 23:50:26 +01:00
Mikkel Krautz
955ca86839 tests: move TestPacketDataStream to the new testing infrastructure. 2017-02-26 23:50:26 +01:00
Mikkel Krautz
7b25a058c2 tests: move TestCrypt to the new testing infrastructure. 2017-02-26 23:50:21 +01:00
Mikkel Krautz
1a1bd8c101 Merge PR #2879: Various minor fixes in preparation for hot-cert reload 2017-02-26 23:00:24 +01:00
Mikkel Krautz
85d62398b1 Merge PR #2880: MurmurIce: remove ad-hoc RSA checks in updateCertificate with Server::isKeyForCert(). 2017-02-26 20:06:06 +01:00
Mikkel Krautz
01f91ec070 MurmurIce: remove ad-hoc RSA checks in updateCertificate with Server::isKeyForCert().
The ad-hoc RSA checks in updateCertificate are unnecessary: we already have a
function that can check whether a given certificate belongs to a given private
key: Server::isKeyForCert().

Rip out the old RSA-specific code (which limited updateCertificate() to only
work with RSA keys), with the more general Server::isKeyForCert().
2017-02-26 19:38:47 +01:00
Mikkel Krautz
1a0e145a9d Meta: remove use of global QSslSocket::defaultCiphers() list.
This removes use of the global QSslSocket::defaultCiphers() list.

Instead, we set the ciphers on each socket individually.
2017-02-26 19:27:23 +01:00
Mikkel Krautz
947eb9071a Move SSL check and version log message to main.cpp from MetaParams::read().
This change moves the QSslSocket::supportsSsl() check from MetaParams:read()
to main.cpp. This also ensures that the SSL check happens very early in Murmur's
initialization process, rather than after we might have already attempted to
call some SSL-related APIs.

This change also moves the log message that prints the OpenSSL version to main.cpp,
and integrates it with the QSslSocket::supportsSsl() check.
2017-02-26 19:25:41 +01:00
Mikkel Krautz
887aa91be6 Meta: add qAbsSettingsFilePath variable.
In order to reload the SSL settings live, we need to know the .ini file
Murmur used when initially loading its settings, in order to re-load the
settings from the same file.
2017-02-26 19:25:40 +01:00
Mikkel Krautz
250a93bbf4 Server: add bUsingMetaCert flag.
This flag is necessary for hot certificate reload.

We need to know which servers are using the Meta certificate/key,
since we will only be able to live-reload SSL settings via SIGUSR1
for those servers. Servers that use their own SSL certificate/key
can't be reloaded via the SIGUSR1 mechanism.

This is because servers that use their own SSL certificate/key store
them in the database. Thus, it is only possible to update those via
RPC using the updateCertificate() method.
2017-02-26 19:25:39 +01:00
Mikkel Krautz
4fbbdda070 Meta: move qmConfig.clear().
This moves the qmConfig.clear() call in MetaParams::read() to the
top of the function.

This allows the SSL part of MetaParams::read() to be moved out to a
separate function in the upcoming PR for live-reloading SSL settings
via the SIGUSR1 signal.
2017-02-26 19:25:38 +01:00
Mikkel Krautz
f2ea3dec5f UnixMurmur: Add USR1 signal handler for reloading SSL settings.
Hot certificate reloading will use the USR1 signal.

This adds the meat of the implementation to UnixMurmur, such that
the PR for live-reloading SSL settings via the SIGUSR1 signal is
more easily digestable.
2017-02-26 19:25:36 +01:00
Mikkel Krautz
21888b11b6 Meta: add 'QSettings *' parameter to MetaParams::typeCheckedFromSettings().
This allows the setting to be loaded from an arbitrary QSettings instance.

We need this to be able to implement live reloading of SSL settings via the SIGUSR1 signal.
2017-02-26 19:25:33 +01:00
Jan Klass
6a9f4913f1 Merge pull request #2799: Reduce SVG icon file size 2017-02-26 16:15:31 +01:00
Mikkel Krautz
fa98f6d6a1 Merge PR #2876: .travis.yml: add 'make check' to the Travis Linux build. 2017-02-26 12:38:30 +01:00
Mikkel Krautz
329dd4ee19 Merge PR #2864: Fix crash when using the VoiceRecorder with voice target shortcuts 2017-02-26 12:38:06 +01:00
Mikkel Krautz
e32f971492 Merge PR #2878: TestCryptographicHash: make test GUI-less. 2017-02-26 11:55:54 +01:00
Mikkel Krautz
fee19347ab TestCryptographicHash: make test GUI-less.
Explicitly set QT = core in order to force Qt's QTEST_MAIN
to use a QCoreApplicaiton instead of a QApplication.

Also, while we're here, move from the deprecated

  CONFIG += qtestlib

to

  QT += testlib
2017-02-26 11:35:28 +01:00
Mikkel Krautz
0df9a37339 Merge PR #2877: Translation update 2017-02-26 11:02:29 +01:00
Mikkel Krautz
4a6074e1f8 Translation update
Updating 'mumble_en.ts'...
    Found 1672 source text(s) (52 new and 1620 already existing)
    Removed 11 obsolete entries
2017-02-26 00:56:11 +01:00
Mikkel Krautz
2abd928ccb .travis.yml: add 'make check' to the Travis Linux build. 2017-02-26 00:54:42 +01:00
Mikkel Krautz
70bf686706 Merge PR #2874: Add make target 'check' to the build. 2017-02-26 00:53:21 +01:00
Mikkel Krautz
f4dfc4a1f0 Audio, AudioOutput: guard against invalid packet types in AudioOutput::addFrameToBuffer().
For packets we receive from Murmur, we check that they're a valid voice
packet on receipt.

However, some packets are not received by Murmur, but generated by the
client itself: packets for RecordUser, and local loopback packets.

If we mess up their type due to a bug, we'd previously allow them into the
AudioOutput system. This commit discards them before they get there.
2017-02-26 00:48:05 +01:00
Mikkel Krautz
aa2683ff81 AudioOutputSpeech: only process Speex packets as Speex.
Otherwise, a malformed packet  could lead to a crash.

Note that this only affects packets generated by Mumble itself,
such as local loopback packets and voice recorder packets.

Packets from the network are filtered in such a way that a
packet with an invalid type will never be able to enter the
audio subsystem -- it is discarded in the network subsystem.
2017-02-26 00:47:51 +01:00
Mikkel Krautz
8294f2daea AudioInput: check iTarget and iPrevTarget for errors before use in flushCheck().
@tatokis reported a voice recorder crash on IRC.
(Also filed as mumble-voip/mumble#2863)

The main culprit was missing error checking in flushCheck() for the values
of iTarget and iPrevTarget.

The problem is that iPrevTarget can be set to -1 in error situations,
when using voice target shortcuts. (Whispers and shouts.)

When that happens, the message type output by flushCheck() will be set
to an invalid value (7), because iPrevTarget is -1.

In flushCheck(), when the packet is a terminator, we set the packet's flags
to the value of iPrevTarget. However, in some error states, iPrevTarget is -1.
When flags is set to -1, all bits are high (say, 0xffffffff on 32-bit
systems). Since all bits are high, our attempt to set the message type in
the flags byte fail, because we attempt to splice it in there via binary
OR.

The result is a packet with an invalid message type of 7 gets into our
audio subsystem and wreaks havoc. Due to mistakes in other code in
AudioOutputSpeech, that invalid value could cause a crash. (The problem
was that we expected that all packets that weren't Opus or CELT to be
Speex. Even 'unknown' message types. This will be fixed in a separate
commit.)

Fixes mumble-voip/mumble#2863
2017-02-26 00:45:02 +01:00
Mikkel Krautz
617247738b Add make target 'check' to the build.
This commits adds a 'make check' target to Mumble's build.

To enable tests, add CONFIG+=tests when configuring the
Mumble build.

It's all based on Qt's existing support for this.
To add a testcase, simply add CONFIG+=testcase to its .pro file.
Then, that test will automatically be built and run when 'make check'
is run.

This commit also adds the recent TestCryptographicHash test to the
test suite, as the -- for now -- only test.
2017-02-26 00:42:09 +01:00
Mikkel Krautz
dcc9236489 Merge PR #2875: qmake/openssl.pri: when using OpenSSL via pkgconfig, ensure link_pkgconfig is in CONFIG. 2017-02-26 00:20:41 +01:00