Commit Graph

284 Commits

Author SHA1 Message Date
Stefan Hacker
e934c1e648 Fix dual-stack UDP on Windows and improve dual-stack detection
This patch fixes dual-stack UDP on Windows as well as for unsual
Linux configurations by ensuring the UDP sockets we create
inherit their IPV6_V6ONLY sockopt from their corresponding
TCP socket. Previously on systems where IPV6_V6ONLY was enabled
by default (e.g. Windows) we would incorrectly create an
IPv6 only socket even though our TCP socket and the system
are dual-stacked.

The dual-stack detection moved from Meta.h to Server.h into the
SslServer class where it is a better fit. Also modified the function
to instead of querying the value of IPV6_V6ONLY on a test socket
it now tries to actively disable it. While previously dual stack
support was only detected if it was the default configuration for
that system, it should now be detected in all cases. The function
also now performs the same check on Windows socket where the default
actually is to have IPV6_V6ONLY enabled.
2015-06-05 02:08:12 +02:00
Mikkel Krautz
6c96ab468f Use 'QSsl::TlsV1_0' on Qt 5.0 through 5.3 and allow 'QSsl::SecureProtocols' to be used on 5.4.X.
Some configurations of Qt 5.X explicitly disable deprecated
parts of the API, such as 'QSsl::TlsV1'. To allow Mumble to build
on those configurations, we have to use 'QSsl::TlsV1_0' instead,
like we did in the prior to 71e522f4c4.

This commit also fixes an issue where QSsl::SecureProtocols was only
selected on the base 5.4.0 release, and not subsequent patch releases.
2015-03-19 14:45:53 +01:00
Mikkel Krautz
71e522f4c4 Use QSsl::TlsV1_0OrLater on Qt 5.5 or later, and QSsl::SecureProtocols on Qt 5.4.
We upstreamed a patch for adding the self-explanatory
QSsl::TlsV1_0OrLater, QSsl::TlsV1_1OrLater and QSsl::TlsV1_2OrLater
enums to QSsl.

Before this, we had a patch in our Qt 5.4 build (on Windows), that
changed the meaning of QSsl::TlsV1_0 to mean "TLSv1.0 or later".
However, that approach wouldn't work in the real world (some setups
require very specific TLS versions), so it was dropped in favour of
the TlsV1_0OrLater and friends.

Since our patch is in Qt 5.5, it means that we now can use
QSsl::TlsV1_0OrLater in the Mumble tree (ifdef'd to QT_VERSION
>= 0x050500), and not break anything for distros.

For Qt 5.4, we can rely on QSsl::SecureProtocols, because Qt 5.4
deprecated SSLv3. Thus, in Qt 5.4, QSsl::SecureProtocols means the
same thing as TlsV1_0OrLater means in Qt 5.5.

Why do we need TlsV1_0OrLater and friends if we have
QSsl::SecureProtocols? Because we don't have a guarantee that
QSsl::SecureProtocols will keep having TLSv1.0 as its minimum
version. The current Mumble protocol requires TLS 1.0.

If something comes up in the future that makes us abandon TLSv1.0,
we'll still handshake it. Rejection can happen at the Mumble protocol
level instead, providing a better user experience.
2015-03-18 23:23:30 +01:00
Stefan Hacker
c5e427d607 Revert "Use TLS 1.2 when built with Qt 5."
This reverts commit 75843b62a7.
2014-12-26 04:41:22 +01:00
Mikkel Krautz
75843b62a7 Use TLS 1.2 when built with Qt 5. 2014-12-25 23:57:48 +01:00
Mikkel Krautz
78ac46880c Murmur: fix override of TcpSocket::incomingConnection(). it takes a qintptr (and not an int) in Qt 5. 2014-12-25 23:57:21 +01: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
main()
dc3b78c914 Add "forceExternalAuth" config option to Murmur
Without this option (or when it's set to false), Murmur's default
authentication will kick in when your external authenticator plugin
crashes and basically allow *anyone* to login and register.

When it's enabled, Murmur will instead return a temporary login
failure to the client.
2014-07-17 20:55:44 +02:00
Mikkel Krautz
84bc19c818 mumble: migrate hardcoded 0x050000 Qt version to the QT_VERSION_CHECK macro. 2013-06-29 16:56:42 +02:00
Mikkel Krautz
5cb337049b mumble, murmur: Qt 5 support for Linux. 2013-06-29 16:56:41 +02:00
Kissaki
b004a4ce0c add a comment, remove an unused variable 2013-06-04 22:38:51 +02:00
Mikkel Krautz
aab9cdcce4 Server::sendMessage: encode the source IP of outgoing UDP packets to match the UDP socket's address family.
Murmur uses the saiTcpLocalAddress field of ServerUser to determine
the correct source address of outgoing UDP packets. On some systems,
such as multi-homed setups, this is important for correct datagram
delivery.

The saiTcpLocalAddress field is initialized when the client first
connects. Its value is extracted from QHostAddress, and then
converted to a sockaddr struct via our own HostAddress class's
toSockAddr method.

HostAddress::toSockAddr is implemented such that any IPv4 address
(including IPv4-mapped IPv6 addresses) will always cause a sockaddr
struct belonging to the AF_INET (IPv4) family to be output. Pure IPv6
addresses will be output as an AF_INET6 sockaddr.

The code that this change touches assumed that it could use the
value of saiTcpLocalAddress directly as the source address in UDP
packets.

This is not always the case. On most systems, Murmur will listen on
[::]:64738 by default, and as such, the address of the server's UDP
socket will be in the AF_INET6 family. Attempting to send packets
with a source address in the AF_INET family using that socket will
cause sendmsg() to return EINVAL on some systems, if not all.

The new code for the sendmsg() code path converts the ServerUser's
saiTcpLocalAddress back into a HostAddress, which, internally, is
fully IPv6. If the input address is IPv4, HostAddress will convert
it to an IPv4-mapped IPv6 address.

When the client's UDP socket is of the AF_INET6 family, we can now
trust that the HostAddress, 'tcpha', is either a real IPv6 address,
or an IPv4-mapped IPv6 address. This allows us to use the 'tcpha'
address regardless of the address family of the saiTcpLocalAddress.
We can simply memcpy it in place.

When the UDP socket is of the AF_INET family, we can only set the
source address if the saiTcpLocalAddress is also AF_INET, or if
it is of the AF_INET6 family and its address is an IPv4-mapped IPv6
address. When a pure IPv6 address is encountered in that path, it is
simply dropped.
2013-06-01 02:54:53 +02:00
Martin von Gagern
d71b2fd04f Ensure that the MAX macro is always defined.
On some systems, none of the (directly or indirectly) included headers does
provide that macro. First reported in https://bugs.gentoo.org/460524
2013-03-27 22:39:58 +01:00
Stefan Hacker
1253532480 setLiveConf for opusthreshold and channelnestinglimit didn't reset on
empty string (#938)
2013-01-10 18:27:59 +01:00
Stefan Hacker
bb76e7aede Fix pre 1.2.4 clients receiving Opus warnings unintentionally.
* Also sent the warning when codec switch decided no switch was necessary
  and Opus wasn't used. Now only sending if Opus is used.
2012-11-28 20:27:42 +01:00
Stefan Hacker
ce83353dbd Make opustreshold and channelnestinglimit accept zero values in setLiveConf. 2012-11-04 18:06:31 +01:00
Stefan Hacker
145d9f96f5 Introduce channel nesting limit (default=10).
Add NestingLimitException to Ice Interface and introduce a new NestingLimit PermissionDenied type.
Addresses #3566322 "ServerDB::deleteServer crashes master"
2012-09-18 17:50:07 +02:00
Stefan Hacker
aa580f392c Trigger codec re-negotiation also on user disconnect and when opusthreshold is set.
- Call recheckCodecVersion on AuthenticatedClient disconnect.
- Make every recheckCodecVersions() call switching to Opus send a message to users only supporting CELT.
2012-08-06 02:29:20 +02:00
Benjamin Jemlich
994e130a9d Murmur: Fix message type detection in Server::processMsg and add a few more comments
Bug found by Rok Kek <rok.kek@gmail.com> which could affect Opus packets.
2012-07-16 19:29:53 +02:00
Benjamin Jemlich
7ec4f6a67c Murmur: Add codec warnings and ignore non-Opus packets if Opus is enabled
Also includes the CELT warning for "broken" clients by Nicos Gollan.
2012-06-08 23:55:56 +02:00
Benjamin Jemlich
f0c16f33ba Murmur: add Opus threshold option 2012-06-08 08:44:02 +02:00
Benjamin Jemlich
84ed2eb84f Murmur: Remove unused DBus.h includes 2012-05-31 13:00:39 +02:00
Benjamin Jemlich
e5c4657c05 Save one more byte in the Opus terminator 2012-03-20 16:03:30 +01:00
Benjamin Jemlich
bd195cd695 Improve Opus terminator flag 2012-03-20 15:05:32 +01:00
Benjamin Jemlich
491cd1eb44 Misc fixes 2012-02-26 08:36:19 +01:00
Benjamin Jemlich
cc8e245c53 Mark Server::log as const 2012-01-14 22:47:32 +01:00
Benjamin Jemlich
8667e6d51d Fix Speak ACL for users entering a channel
clearACLCache doesn't just clear the cache, it also adds
some entries, which might be wrong if we're calling it before
changing the channel for a user. Fix this by not using the cache
for the ACL test.
2012-01-08 13:01:14 +01:00
Benjamin Jemlich
2b9e094ab2 Allow using ChanACL::hasPermission without a cache 2012-01-08 12:59:47 +01:00
Benjamin Jemlich
fc322ea171 Fix compile error 2012-01-07 01:18:53 +01:00
Benjamin Jemlich
17eb6cce39 Apply suppress ACL before switching channels
People were able to send a few voice packets to the new channel
prior to being switched to their new channel. Applying the Whisper ACL
before changing the current channel should fix that.
2012-01-07 00:52:26 +01:00
Benjamin Jemlich
356bd2ea7a Obey Whisper ACL for User-to-User Whispers 2012-01-07 00:41:51 +01:00
Benjamin Jemlich
87376a937c Fix strong cert check for self-signed server certificates
If the server is using a self-signed certificate the strong
certificate check for the client cert will fail with a
"The certificate is self-signed" error even if it's a valid
cert. It looks like Qt is propagating the "error" for the server
certificate to the client cert check. Adding the server certificate
as a CA certificate fixes the problem.
2012-01-04 14:08:57 +01:00
Benjamin Jemlich
29e7a54d30 Change Opus packets to remove the library hack 2011-11-20 01:05:18 +01:00
Benjamin Jemlich
bb2ef526aa Windows build fixes 2011-11-11 18:56:14 +01:00
Benjamin Jemlich
07737a314c Fix include guards and PCH includes 2011-11-09 00:12:10 +01:00
Thorvald Natvig
86fc793a5d Opus codec negotiation (server) 2011-11-06 19:00:33 -08:00
Benjamin Jemlich
7586a61226 Add basic Opus support 2011-11-05 23:21:22 +01:00
DNW
a8975fe6bc Add Server::effectivePermissions() to ICE (https://sourceforge.net/tracker/?func=detail&aid=3389065&group_id=147372&atid=768008) 2011-10-01 18:37:48 +02:00
Benjamin Jemlich
eeb1737be4 Fix UDP problems on IPv4 only hosts
The kernel (at least older versions) want the exact length of the control data
otherwise it will discard the packet.
2011-06-15 08:15:15 +02:00
Thorvald Natvig
7de5ebc18f Indent, changelog, submodule and language update 2011-06-11 02:58:17 +02:00
Benjamin Jemlich
fbeed39c02 Fix iObfuscate for IPv6
IPv6-mapped IPv4 addresses contain to many zeros to
use XOR without revealing the "key". Switching the
output to a sha1 hash of the random value + the address
solves the problem. We don't include the port in the hash
because it's useful to see which connection attempts were
from the same IP address even if you can't read the actual
value.
2011-05-16 11:36:49 +02:00
Thorvald Natvig
45bd8139fe Fix murmur warnings 2011-05-15 16:45:46 -07:00
Benjamin Jemlich
7529297760 Fix uppercase vs lowercase vs PCH include problems 2011-05-15 17:15:54 +02:00
Benjamin Jemlich
900f1e5677 Opus support for the server
Untested but should work because it's only a minor modification
of the existing CELT/Speex code.
2011-05-14 10:09:08 +02:00
Benjamin Jemlich
6d6afca9b0 Fix changing iMaxUsers
Lowering the user limit and raising it again would add duplicate
session IDs to the session ID queue.

Recreate the queue if the limit changes to fix the problem and
ignore IDs which are too high for the new user limit when
someone disconnects.
2011-05-14 09:39:33 +02:00
Thorvald Natvig
07bf14614a Use TCP destination as UDP source 2011-05-11 07:25:56 +02:00
Thorvald Natvig
d96648ef25 Answer ping from same UDP address sent to (Linux only for now) 2011-05-08 10:41:35 +02:00
Thorvald Natvig
94967abfd8 Suggest Config 2011-03-25 19:54:26 -07:00
Thorvald Natvig
f3437a6ba7 Update copyright year ranges of dev team. 2011-03-18 05:52:51 +01:00
Benjamin Jemlich
7c66886bab Move bDisconnectEmitted down by one level 2010-12-24 00:55:45 +01:00