Commit Graph

8246 Commits

Author SHA1 Message Date
Robert Adam
3583235542 FIX(text-chat): Fix crash on TextMessage from server
1a4d134a35 introduced the ability to
disable TTS for specific users. The change however didn't account for
messages that are sent from the server. In these cases pSrc is nullptr
but that commit introduced code that access it without checking for
null. This lead to a SegFault as soon as a text message from the server
is received.

This commit fixes this by simply adding a null-check before accessing
the variable.
2020-06-20 11:39:29 +02:00
Robert Adam
2a41d5af07
Merge pull request #4244: UserLocalVolumeDialog: "Inherit" AlwaysOnTop behavior
Before this PR, if the MainWindow was set to be always on top of
other windows, it could happen that the UserLocalVolumeDialog got hidden
behind the MainWindow (it wanted to open on top of it but since the
MainWindow is set to be on top of all other windows, it couldn't). This
could be especially annoying on Windows where you can't move the
MainWindow away as long as the UserLocalVolumeDialog is open (luckily
you can close it via Esc though).

In order to avoid this kind of situation, this commit make the
UserLocalVolumeDialog "inherit" the AlwaysOnTop flag from the
MainWindow. This way it can open on top of it again and won't be hidden.
2020-06-19 20:21:17 +02:00
Robert Adam
cd60ea5023
Merge pull request #4287: Allow disabling of TTS for specific users
These changes make it possible to disable Text-To-Speech for specific
users while still receiving the messages as normal text.

A use case for this would be muting text to speech for a music bot.
2020-06-17 19:45:33 +02:00
Popkornium18
06e558a870 Translation update
Updating 'mumble_en.ts'...
    Found 1873 source text(s) (4 new and 1869 already existing)
2020-06-17 18:41:02 +02:00
Popkornium18
1a4d134a35 FEAT(tts): Allow disabling Text-To-Speech per user
These changes make it possible to turn of TTS for a specific user while
still receiving their messages.

This setting can be managed from the context menu of a user that is
connected to the server and is only visible when TTS is enabled
globally.

A new DB table called 'ignored_tts' had to be created to persist this
setting.
2020-06-17 18:41:02 +02:00
Robert Adam
73c535b25d
Merge pull request #4275: MAINT: Create commit guidelines 2020-06-16 10:00:46 +02:00
Robert Adam
8834fbcfd0 MAINT: Create commit guidelines 2020-06-15 08:11:35 +02:00
Robert Adam
9f5aab48f8
Merge pull request #4293: FIX(certificate): Properly process signed certificates
This fixes a regression introduced in
b691108. In there it was thought that
there is no need to explicitly add the system CaCertificates to the SSL
configuration. This turned out to be wrong.

It was brought up that by removing this line, properly signed
certificates would also be shown as self-signed.

Fixes #4289
2020-06-14 15:01:44 +02:00
Robert Adam
6da56c774e
Merge pull request #4285: REFAC(lgtm): Removed subsequently overwritten key
Dictionary key 'key_exchange' is subsequently overwritten.
2020-06-14 09:34:38 +02:00
Robert Adam
ba9ae91614 FIX(certificate): Properly process signed certificates
This fixes a regression introduced in
b691108d38. In there it was thought that
there is no need to explicitly add the system CaCertificates to the SSL
configuration. This turned out to be wrong.

It was brought up that by removing this line, properly signed
certificates would also be shown as self-signed.

Fixes #4289
2020-06-14 09:14:50 +02:00
Robert Adam
e011cac4f2
Merge pull request #4265: Send image pasted into the chat bar
Implements functionality to send an image by copy and paste into the chat bar of mumble.
This is a commonly expected behavior of any chat app. Can't see why mumble should not have one.
Furthermore it also implements Drag&Drop for images to the chatbar.
2020-06-14 08:43:45 +02:00
Terry Geng
8e316b37dd
Translation update
Info: creating stash file /Users/terrygeng/Desktop/mumble-voip/mumble/src/mumble/.qmake.stash
Updating 'mumble_en.ts'...
    Found 1871 source text(s) (2 new and 1869 already existing)
2020-06-13 09:13:37 +08:00
Terry Geng
b3a1441a46
FEAT: Send images dragged onto the chat bar. 2020-06-13 09:13:13 +08:00
Konstantin Goncharik
bd3a70206d
REFAC(lgtm): Removed subsequently overwritten key
Dictionary key 'key_exchange' is subsequently overwritten.
2020-06-12 22:39:01 +07:00
Jan Klass
d73465e3a2
Merge PR #4282: Fix overlay not showing
This PR makes the overlay work again (got broken in aac3214) and furthermore makes sure that it really only is initialized if needed.
2020-06-12 14:56:09 +02:00
Robert Adam
18da1a0ba7 REFAC(overlay): Move init in own function
The initialization code is now moved into its own function (instead of
also living inside the setActive function body). This is done in order
to better separate initialization and activation.
2020-06-12 12:52:59 +02:00
Robert Adam
fda80a6767 FIX(overlay): Initialize only when activated
In the old implementation the overlay was initialized as soon as
Overlay::setActive got called regardless of whether it was asked to
actually activate.

This commit makes sure to only initialize the Overlay if it is actually
asked to be activated via Overlay::setActive(true).
2020-06-12 12:41:52 +02:00
Robert Adam
cfe1f6b5d5 FIX(overlay): Make overlay work again
In aac3214d4b Overlay::createPipe() has
been introduced in order to only create the pipe when needed (instead of
in the constructor of the Overlay class). This new function was never
called though which caused the Overlay to stop working.

This commit makes sure the respective function is called when activating
the overlay.

Fixes #4281
2020-06-12 12:41:32 +02:00
Terry Geng
febb4b1993
FEAT: Send image pasted onto the chat bar. 2020-06-12 10:19:46 +08:00
Robert Adam
974ee68df3
Merge pull request #4276: Replace deprecated constructs
This PR is about replacing stuff that has been deprecated in Qt 5.15
2020-06-11 14:22:50 +02:00
Davide Beatrici
3770d0e7d1
Merge PR #4280: CI: change update target for AppImages 2020-06-11 11:07:34 +02:00
Robert Adam
bdb12c6622 REFAC(deprecated): set certificates on QSslConfiguration
Previously the certificates were added to the QSslSocket object directly
but Qt 5.15 added this functionality to the QSslConfiguration object and
deprecated the ones in QSslSocket.
2020-06-11 10:23:29 +02:00
Robert Adam
4977ef429d
CI: change update target for AppImages
Previously AppImages built on the CI got their updates from https://dl.mumble.info/snapshots/
but now we have a separate directors `nightly` that'll contain CI build artifacts and this should be used instead.
2020-06-11 09:49:54 +02:00
Robert Adam
0fcafd86e7 REFAC(deprecated): Use QFlag default constructor
Qt 5.15 has introduced a default constructor for a QFlag that will be
equivalent of setting it equal to a zero literal (setting it to no
flag).
2020-06-11 08:14:44 +02:00
Robert Adam
62c215e924 REFAC(deprecated): Replace qrand
qrand() has been deprecated in Qt 5.15. Therefore this commit replaces
it with QRandomNumberGenerator as recommended by Qt.

As the RNG returned by QRandomNumberGenerator::global() (which was used
throughout this refactoring) is already seeded (according to the docs),
there is no need to explicitly seed the RNG in the main function as has
been done before by calling qsrand().
2020-06-11 08:14:18 +02:00
Robert Adam
07836a0e69 REFAC(deprecated): Replace deprecated QString::SkipEmptyParts
Qt 5.14 has introduced Qt::SplitBehavior which now holds the flag that
were previously contained in the QString class. The fields still exist
in QString but they are deprecated since Qt 5.15.
2020-06-10 19:31:34 +02:00
Robert Adam
b691108d38 REFAC(crypto): remove QSslSocket::addDefaultCaCertificates
The function in question has been deprecated in Qt 5.15. Instead it is
recommended to set the CA certificates on the QSslConfiguration object.
According to the docs of QSslConfiguration however the system's CA
certificates is what is used by default anyways.

Quote (from 5.15 docs of QSslConfiguration::systemCaCertificates):
"This function provides the CA certificate database provided by the
operating system. The CA certificate database returned by this function
is used to initialize the database returned by caCertificates() on the
default QSslConfiguration."
2020-06-10 16:10:27 +02:00
Davide Beatrici
7c67ea33f4
Merge PR #4267: src/mumble/AudioOutput.ui: Fix stacked elements 2020-06-09 04:45:16 +02:00
Robert Adam
51bb253b47 src/mumble/AudioOutput.ui: Fix stacked elements
Some labels were stacked on top of each other in the Positional Audio
section of the settings page. This probably happened in a wrongly
resolved merge-conflict and is corrected by this commit.
2020-06-08 19:47:58 +02:00
Davide Beatrici
1e17326d29
Merge PR #4250: Fix: Resizing buffer in audio callback causes mumble to crash 2020-06-08 06:01:21 +02:00
Terry Geng
42f7339e04
src/mumble/AudioSampleOutput: Fix the glitch sound caused by bad sample count 2020-06-08 11:16:17 +08:00
Terry Geng
50313b1159
src/mumble/CoreAudio: resize buffer outside audio callback, for CoreAudio 2020-06-08 11:16:16 +08:00
Terry Geng
652585e59a
src/AudioOutput: resize buffer outside audio callback, for PulseAudio 2020-06-08 11:16:16 +08:00
Robert Adam
181e06ef22
Merge pull request #4256: src/mumble: remove positional audio check in audio backends
The check was originally implemented to avoid initializing multiple channels when it was guaranteed only one would be available (i.e. positional audio disabled).

Now that we support stereo audio decoding (#4209), the check has to be removed in order to make the feature available when positional audio is disabled.
2020-06-07 20:30:25 +02:00
Robert Adam
26df051cef
Merge pull request #4254: src/CoreAudio: update CoreAudio API, remove deprecated API calls. 2020-06-07 19:19:08 +02:00
Davide Beatrici
f1e5a9f5de src/mumble: remove positional audio check in audio backends
The check was originally implemented to avoid initializing multiple channels when it was guaranteed only one would be available (i.e. positional audio disabled).

Now that we support stereo audio decoding, the check has to be removed in order to make the feature available when positional audio is disabled.
2020-06-06 22:14:30 +02:00
Terry Geng
d98181276b
src/mumble/CoreAudio: Reformatted files. 2020-06-07 00:03:38 +08:00
Robert Adam
6dd5db768c
Merge pull request #4253: TalkingUI: Fix ghost users
When a client disconnected from the server that was still talking and
therefore showing up in the TalkingUI, it could happen that this user
was not removed from it even though it was no longer on the server. This
is due to a race-condition in the event chain: It could happen that the
respective user object got deleted before the on_talkingStateChanged
function in the TalkingUI got called. This then led to this function not
getting a reference to the user object which causes it to return.

This commit explicitly wires up the UserRemove event with the TalkingUI
to make sure a user gets removed from it once it is removed from the
server.
2020-06-06 17:21:40 +02:00
Terry Geng
fe208887a6
src/CoreAudio: update CoreAudio API, remove deprecated API calls. 2020-06-06 22:27:26 +08:00
Robert Adam
d3dcfcc2dd TalkingUI: Fix ghost users
When a client disconnected from the server that was still talking and
therefore showing up in the TalkingUI, it could happen that this user
was not removed from it even though it was no longer on the server. This
is due to a race-condition in the event chain: It could happen that the
respective user object got deleted before the on_talkingStateChanged
function in the TalkingUI got called. This then led to this function not
getting a reference to the user object which causes it to return.

This commit explicitly wires up the UserRemove event with the TalkingUI
to make sure a user gets removed from it once it is removed from the
server.
2020-06-06 16:19:14 +02:00
Robert Adam
f9a5b901cc
Merge pull request #4238: Crypto abstract class
This is an attempt to provide a unified interface for all crypto classes, in order to support multiple ciphers and the crypto negotiation mentioned in #3918 in the future.

That being said, I have to readdress the sad fact that I'm not a C++ expert and have no previous experience of developing a huge project like mumble, hence I'm not very sure about all my moves, whether I'm using the best practice or not. I sincerely hope you guys may provide some insights and suggestions and I would be surely grateful for that.
2020-06-06 15:55:49 +02:00
Terry Geng
80a3108b59
src: Log failed resync attempts due to invalid key/nonce. 2020-06-06 20:38:11 +08:00
Terry Geng
e90eb8c4cd
src: Made CryptState an abstract class, in order to support multiple crypto types in the future. Moved all crypto-related files into src/crypto. 2020-06-06 20:37:59 +08:00
Robert Adam
5f421e64f7
Merge pull request #4227: Safeguard from potential attacks against OCB2
As explained in https://github.com/mumble-voip/mumble/issues/4219#issuecomment-636218461:

    In simple terms:

    Never encrypt any message where the second to last block starts (or ends? don't recall how len was actually implemented in OCB2. be sure not to mess this one up! if unsure, just do both) with 120 bits of zeros.
    Ignore any decrypted message which we would not have encrypted according to 1.

    Given we mostly send compressed audio over UDP, it seems unlikely that there would ever legitimately be 120 bits of zeros, so impact should be minimal. Ping packets are probably only a single block in size, so they're not affected either.
    Removing either encryption or decryption oracle will make the attacks impossible. And because a Mumble client never decrypts its own packets, if we take away both on the server, even un-patched clients should be safe (as long as they're connected to a patched server) and vice-versa (though ofc the other way around all the participating clients would have to be patched if the server isn't since any one of them could leak the full conversation).

The respective paper can be found at https://eprint.iacr.org/2019/311
2020-06-06 11:04:34 +02:00
Robert Adam
39d2535545
Merge pull request #4249: remove double html escaping from markdown.
Special characters inside of markdown code in the chat were escaped twice.
The message **<test>** was previously escaped to **&lt;test&gt;**.
The markdown code changed the ** to <b> tags,
but also escaped the & character again, resulting
in <b>&amp;lt;test&amp;gt;</b>.
Due to the double escaping, special characters like < were not
displayed correctly.

Fixes: #4179
2020-06-05 18:41:28 +02:00
Lukas Beckmann
c0aa408d61 src/mumble/Markdown.cpp remove double html escaping from markdown.
Special characters inside of markdown code in the chat were escaped twice.
The message **<test>** was previously escaped to "**&lt;test&gt;**".
The markdown code changed the "**" to "<b>" tags,
but also escaped the "&" character again, resulting
in "<b>&amp;lt;test&amp;gt;</b>".
Due to the double escaping, special characters like "<" were not
displayed correctly.

Fixes: #4179

Co-authored-by: Fabian Muentefering <fabian.muentefering@stud.uni-hannover.de>
2020-06-05 16:37:57 +02:00
Jonas Herzig
be97594046 Safeguard from potential attacks against OCB2
OCB2 is known to be broken under certain conditions:
https://eprint.iacr.org/2019/311

To execute the universal attacks described in the paper, an attacker needs
access to an encryption oracle that allows it to perform encryption queries with
attacker-chosen nonce. Luckily in Mumble the encryption nonce is a fixed counter
which is far too restrictive for the universal attacks to be feasible against
Mumble.

The basic attacks do not require an attacker-chosen nonce and as such are more
applicable to Mumble. They are however of limited use and do require an en- and
a decryption oracle which Mumble seemingly does not provide at the same time.

To be on the safe side, this commit implements the counter-cryptanalysis
measure described in the paper in section 9 for the sender and receiver side.
This way if either server of client are patched, their communication is almost
certainly (merely lacking formal proof) not susceptible to the attacks described
in the paper.
2020-06-05 12:56:18 +02:00
Robert Adam
25febac815
Merge pull request #4105: Use REPLACE instead of INSERT
In #3803 it is reported that the server regularly crashes because the
MySQL/SQLite part of the database code for group changes doesn't handle
conflicts in primary keys (as the PostgreSQL part does).

This commit makes the SQL statement use REPLACE INTO instead of INSERT
INTO which according to the docs "REPLACE works exactly like INSERT,
except that if an old row in the table has the same value as a new row
for a PRIMARY KEY or a UNIQUE index, the old row is deleted before the
new row is inserted."

It's actually a MySQL extension but according to Wikipedia SQLite
supports it as well.
2020-06-05 12:07:26 +02:00
Robert Adam
800c7aa655
Merge pull request #4243: Group all attenuation settings together
Before this commit we had 3 places in the AudioOutput settings page that
dealt with stuff related to attenuation (1 in the "Audio Output"
section, the "Advanced Attenuation Options" and the "Priority Speaker"
section).
This PR merges all of them into a single "Attenuation" section.
2020-06-05 10:58:18 +02:00
Robert Adam
81b68f384e
Merge pull request #4245: CXX-STANDARD: Enforce (at least) cpp14 2020-06-05 10:05:21 +02:00