0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

50 Commits

Author SHA1 Message Date
Richard Stanway
d1159087f1 obs-outputs: Add additional paths for root certificates on Linux
Fixes https://github.com/obsproject/obs-studio/issues/2350. Also adds
some log file output for when the root certificates can't be loaded to
make it more obvious what the problem is.
2020-01-25 16:49:11 +01:00
Richard Stanway
2b131d212f obs-outputs: Fix librtmp mbedtls thread safety
Per mbedtls documentation, "If you share a context between threads, you
need to call these functions only from the main thread, at the beginning
and end of the context's lifetime.". OBS violated this since librtmp
uses a global context and it was allocated and freed in different
threads such as the auto config test.

This commit attaches the mbedtls context to an RTMP structure so there
is no more global state. It also fixes a rare double-free crash that
could occur if RTMP_TLS_Free was called twice (this happened in rare
situations such as the auto config running followed by a mode change
from Advanced to Simple).
2020-01-23 00:11:23 +01:00
Kurt Kartaltepe
4d89123cdc librtmp: Allow partial success for mbedtls
mbedtls_x509_crt_parse_path returns a positive number if it partially
succeeds and a negative number on complete failure. This changes the
positive result to no longer error and prevent TLS connections (OBS
verifies all endpoints so having no CA chain prevents TLS).
2020-01-12 13:31:39 -08:00
Florian Zwoch
2699bbbd77 obs-outputs: Fix mbedtls use of deprecated functions
mbedtls_md5_starts(), mbedtls_md5_update() and mbedtls_md5_finish()
have been marked deprecated since mbedtls version 2.7 and may go
away in the future.

These function have been superseded by versions with a return
value. They are suffixed with "_ret". We do not actually check
return values.

Also the header "mbedtls/net.h" has been superseded by
"mbedtls/net_sockets.h".
2020-01-08 11:45:55 +01:00
jp9000
53615ee10f clang-format: Add clang-format files 2019-06-23 01:53:56 -07:00
James Park
2ff9cf17c0 obs-outputs: Fix undefined MSG_NOSIGNAL
Define MSG_NOSIGNAL even if CRYPTO is not defined.
2019-05-09 22:38:34 -07:00
Tristan Matthews
94c881b891 obs-outputs: Return error instead emitting SIGPIPE
This could happen if writing to a socket which was closed by the peer.
2019-05-09 17:05:38 -07:00
pkv
a5b837518e obs-outputs: Fix leak with certs for rtmp 2019-04-21 23:54:27 +02:00
Jim
06488a55ce
Merge pull request #1416 from admshao/cleanup-macro-declaration
Cleanup Compilation warnings
2018-09-07 00:51:58 -07:00
Shaolin
bf72435db8 obs-outputs: Fix unused variable compiler warning
Some security layer libraries code path used by the rtmp output had a
not used variable and not used param on HMAC_finish macro that was
triggering warnings during compilation.
2018-09-06 22:10:29 -03:00
Shaolin
d500ef3bb5 obs-outputs: Make rtmp packet alloc code path clearer
On 64bit systems, this check will always evaluate to false due to
SIZE_MAX type and triggers a compiler warning.

This both makes it clearer that its only needed on 32bit system and
clear the compiler warning.
2018-09-06 22:10:24 -03:00
Richard Stanway
c68d022f9c
obs-outputs: Revert f1f49bc1 to fix RTMP authentication
This reverts commit f1f49bc197, which
breaks RTMP authentication as these parameters are intended to "leak"
into the next use of the RTMP context.
2018-08-27 15:04:39 +02:00
Michael Goulet
e67e2e12e6 obs-outputs: Add support for and use mbedTLS for SSL
This diff adds mbedTLS support to the obs-outputs plugin.  PolarSSL and
mbedTLS have grown so different between 2015-or-so when libRTMP was
written, and now it's no longer feasible to just use the USE_POLARSSL
flag.

This commit adds a WITH_RTMPS tri-state CMake variable (auto/on/off),
set to "Auto" by default.  "Auto" will use RTMPS if mbedTLS is found,
otherwise will disable RTMPS.  "On" will make it require mbedTLS,
otherwise fails configuration, and "Off" disables RTMPS support
altogether.

Closes obsproject/obs-studio#1360
2018-08-05 18:40:49 -07:00
Richard Stanway
cc69ec16ec
obs-outputs: Update librtmp with upstream patches
Mostly security / reliability related, fixing various access to
uninitialized data, integer overflows, etc from
https://git.ffmpeg.org/rtmpdump
2018-07-23 23:22:37 +02:00
pkviet
f1f49bc197 librtmp: Fix memory leak
A leak was introduced by commit 1682d77 (July 11 2015).
This is a fix.
2018-06-07 00:44:29 +02:00
jp9000
cb47c61e42 Revert "obs-outputs: Fix FMS auth with query string"
This reverts commit 5cf11d6726.
2018-01-22 05:40:26 -08:00
Matt Morrissette
5cf11d6726 obs-outputs: Fix FMS auth with query string
Fix FMS authentication to support RTMP connection URLs that have a
query string parameter already.

Closes jp9000/obs-studio#1105
2018-01-05 15:52:14 -08:00
Shaolin
cb9f767e45 libobs/plugins/UI: Suppress -Wimplicit-fallthrough introduced by GCC 7
Signed-off-by: Shaolin <admshao@gmail.com>
2017-05-29 21:05:18 -03:00
Ryan Foster
972c470319 librtmp: Fix build error with ENODATA on FreeBSD
When building on FreeBSD before this patch, it would produce the error
"error: use of undeclared identifier 'ENODATA'". This fixes that.
2017-05-25 03:48:53 -04:00
Richard Stanway
92a258690e
obs-outputs: Add output error messages for RTMP 2017-05-15 12:05:44 +02:00
jp9000
585b3ed945 obs-outputs: Add connect time callback for rtmp output 2017-05-06 11:29:35 -07:00
Richard Stanway
f8617bd359 librtmp: Clean up our extra RTMP fields on close 2017-02-25 06:16:19 -08:00
Richard Stanway
7df46d4a8e
obs-outputs: Fix librtmp IP bind / resolve behavior
Fixes a case where OBS would prefer trying to connect
to an IPv4 address even though you had bound it to an
IPv6 interface for example.
2016-11-30 22:11:17 +01:00
Richard Stanway
4d23e84837
librtmp: Remove reconnect on close behavior
For some reason librtmp treats a close message as a request to reconnect.
It does this syncronously, and uses the same event processing so that
another close request will continue the cycle until the stack is exhausted
and the application crashes.

Fixes https://obsproject.com/mantis/view.php?id=634
2016-09-27 00:37:59 +02:00
Richard Stanway
eca0ca8424
obs-outputs: Prefer IPv4 addresses for RTMP connections 2016-08-15 17:58:01 +02:00
yogpstop
4b4ddbb33e obs-outputs: Add USE_SSL option (disabled by default)
Closes jp9000/obs-studio#487
2016-02-07 15:47:18 -08:00
jp9000
77c538bd33 obs-outputs: Disabled OpenSSL deprecated warnings on apple
Apple wants to get people to move over to their own crypto APIs instead
of using OpenSSL, so disable the warning in the files where OpenSSL is
used for the time being.
2016-02-07 15:33:10 -08:00
jp9000
867c58472e obs-outputs: Fix a few warnings in librtmp 2016-02-07 15:33:10 -08:00
Jess Mayo
f1a6b37e8e obs-outputs: Add bounds checking to b64enc
This fixes "warning: unused parameter 'maxsize' [-Wunused-parameter]"
introduced when authentication was turned on.
2015-07-12 12:34:47 +09:00
Jess Mayo
cec88d2897 obs-outputs: Fix stuck "Connecting" with no key
With no stream key, no streams were actually being created.
This is a crazy configuration anyway, but it resulted in OBS getting
stuck in the "Connecting" state with no way to cancel.
We now just use the blank key and hope for the best.
2015-07-11 14:01:11 +09:00
Jess Mayo
1682d77df3 obs-outputs: Fix rtmp authentication
Reinstate flag checks in RTMP_Close that were erroneously removed.

Clear out the Link state before we establish a new connection. There is
too much state carried around during authentication that has no good
place to clear it in librtmp, which assumes a clean structure when the
connection is initially established.
2015-07-11 13:53:07 +09:00
Jess Mayo
132e58fb31 obs-outputs: Enable rtmp authentication
Authentication code has been updated as per the changes to support
multiple streams.

Authentication is now also enabled by default, and should be a no-op
if the server does not request authentication or username and password
details are not provided.
2015-07-07 19:55:35 -07:00
jp9000
c69b70b847 obs-outputs: Fix bug (RTMP only working once)
This was caused to do the new RTMP code that added support for multiple
streams; the stream index needs to be reset on RTMP_Close otherwise it
will keep using the wrong stream information.
2015-02-17 20:38:23 -08:00
jp9000
d3c8f81cc2 obs-outputs: Fix potential RTMP auth issue 2015-02-17 17:23:32 -08:00
Palana
8a3dd2ef8a librtmp: Try to parse IPv6 addresses
This should (hopefully) allow URLs of the form rtmp://[abcd::1]/app
2015-02-11 17:52:56 +01:00
Palana
ce25cf86b6 librtmp: Remember addrlen from getaddrinfo
OS X doesn't like sizeof(struct sockaddr_storage) as last parameter
for connect
2015-02-11 17:52:56 +01:00
Palana
b7375fd1be Revert "Revert "obs-outputs: Update to latest librtmp version""
This reverts commit ac72e0392d.
2015-02-11 17:40:14 +01:00
jp9000
ac72e0392d Revert "obs-outputs: Update to latest librtmp version"
This reverts commit 36666c6712.
2015-02-09 19:30:11 -08:00
jp9000
6b38fa35b0 Use _MSC_VER for MSVC-specific pragmas
These aren't used on mingw so they need to be surrounded by #ifdef
_MSC_VER
2015-02-09 03:49:18 -08:00
jp9000
73d3be9311 obs-outputs: Use INVALID_SOCKET instead of -1
On windows, for whatever reason sockets use the SOCKET type which is not
a signed integer.  Still, even though it's not a signed integer, -1 is
used to indicate an invalid socket, but the way you use it is via
microsoft's fabulously dumb little INVALID_SOCKET define, so we have to
make librtmp use that instead.
2015-02-09 03:49:17 -08:00
jp9000
5dfecab15c Fix windows printf format warnings (from mingw) 2015-02-09 03:49:14 -08:00
jp9000
7c5034d58f obs-outputs: Add support for multi-track RTMP
Certain RTMP services will support multi audio tracks via RTMP.  This
updates librtmp with custom code that enables multiple streams per
connection to be used; each subsequent stream typically containing extra
audio tracks.  The audio encoder names are used to indicate the names of
tracks, and the name of the tracks are used for the stream keys for
those subsequent tracks.
2015-02-04 16:51:56 -08:00
jp9000
36666c6712 obs-outputs: Update to latest librtmp version
Should be all the fixes and updates made by R1CH, mostly bug fixes as
well as IPv6 support
2015-02-04 16:51:55 -08:00
jp9000
1188ad7561 Fix unreachable code warning 2014-07-12 12:00:12 -07:00
BtbN
b3adef6c8d Fix all warnings in rtmp output 2014-05-10 03:40:23 +02:00
Palana
07ab8271b6 Remove setsockopt for SIGPIPE; disable SIGPIPE via signal() on non-WIN32 2014-04-24 23:50:40 +02:00
Palana
138bf4cc1e Disable SIGPIPE for RTMP socket in librtmp 2014-04-24 23:28:12 +02:00
Palana
d0e3f0d6a3 Fix (debug build) warnings in librtmp 2014-04-08 15:57:21 +02:00
Palana
d45248d6ad Add preprocessor flag for librtmp network dumps
Fixes debug compilation on non-WIN32 targets due to undefined
netstackdump(_read) symbols
2014-04-08 15:41:12 +02:00
jp9000
ed6fc7b122 Add librtmp to obs-outputs
Note that this is a somewhat heavily modified custom version of librtmp.
I modified all the platform specific code that we were using for the
OBS1 to make it platform-independent.

I don't really like the code in this library, but it works well enough,
so I can't really fault anyone for it.  It's just very..  unclean.  Even
for a C library, quite unclean.  Some parts are also a little less safe
than I'd prefer as well.
2014-04-01 11:48:28 -07:00