aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-11-01 16:26:36 -0300
committerJames Almer <jamrial@gmail.com>2017-11-01 16:52:05 -0300
commit4600b0619afc58b58de1a21d7a2c472e0d788282 (patch)
tree73b866d214b0214fae5e92fb524fe58f84a9fa8e
parentbc98788dd262aacf017fb27d3e1de03f9009839f (diff)
parent61cec5adaacb358783c18aa07362f15824c1b274 (diff)
downloadffmpeg-4600b0619afc58b58de1a21d7a2c472e0d788282.tar.gz
Merge commit '61cec5adaacb358783c18aa07362f15824c1b274'
* commit '61cec5adaacb358783c18aa07362f15824c1b274': tls: Hide backend implementation details from users Also includes ed434be106a4615e0419b3ac7664220741afda2d Changes were made to support schannel and securetransport. Merged-by: James Almer <jamrial@gmail.com>
-rwxr-xr-xconfigure18
-rw-r--r--libavformat/Makefile9
-rw-r--r--libavformat/network.c12
-rw-r--r--libavformat/protocols.c5
-rw-r--r--libavformat/tls.h2
-rw-r--r--libavformat/tls_gnutls.c2
-rw-r--r--libavformat/tls_openssl.c2
-rw-r--r--libavformat/tls_schannel.c2
-rw-r--r--libavformat/tls_securetransport.c2
9 files changed, 25 insertions, 29 deletions
diff --git a/configure b/configure
index 63ee46a53b..998ac74e9e 100755
--- a/configure
+++ b/configure
@@ -3160,21 +3160,14 @@ rtmpte_protocol_suggest="zlib"
rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
rtmpts_protocol_suggest="zlib"
rtp_protocol_select="udp_protocol"
+schannel_conflict="openssl gnutls"
sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
sctp_protocol_select="network"
+securetransport_conflict="openssl gnutls"
srtp_protocol_select="rtp_protocol srtp"
tcp_protocol_select="network"
-tls_gnutls_protocol_conflict="tls_schannel_protocol tls_securetransport_protocol"
-tls_gnutls_protocol_deps="gnutls"
-tls_gnutls_protocol_select="tcp_protocol"
-tls_openssl_protocol_conflict="tls_schannel_protocol tls_securetransport_protocol tls_gnutls_protocol"
-tls_openssl_protocol_deps="openssl"
-tls_openssl_protocol_select="tcp_protocol"
-tls_schannel_protocol_deps="schannel"
-tls_schannel_protocol_select="tcp_protocol"
-tls_securetransport_protocol_deps="securetransport"
-tls_securetransport_protocol_select="tcp_protocol"
-tls_protocol_deps_any="tls_schannel_protocol tls_securetransport_protocol tls_gnutls_protocol tls_openssl_protocol"
+tls_protocol_deps_any="gnutls openssl schannel securetransport"
+tls_protocol_select="tcp_protocol"
udp_protocol_select="network"
udplite_protocol_select="network"
unix_protocol_deps="sys_un_h"
@@ -3752,6 +3745,9 @@ map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
+enabled_all gnutls openssl &&
+ die "GnuTLS and OpenSSL must not be enabled at the same time."
+
# Disable all the library-specific components if the library itself
# is disabled, see AVCODEC_LIST and following _LIST variables.
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 591a14b978..caebe5b146 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -586,10 +586,11 @@ OBJS-$(CONFIG_SRTP_PROTOCOL) += srtpproto.o srtp.o
OBJS-$(CONFIG_SUBFILE_PROTOCOL) += subfile.o
OBJS-$(CONFIG_TEE_PROTOCOL) += teeproto.o tee_common.o
OBJS-$(CONFIG_TCP_PROTOCOL) += tcp.o
-OBJS-$(CONFIG_TLS_GNUTLS_PROTOCOL) += tls_gnutls.o tls.o
-OBJS-$(CONFIG_TLS_OPENSSL_PROTOCOL) += tls_openssl.o tls.o
-OBJS-$(CONFIG_TLS_SCHANNEL_PROTOCOL) += tls_schannel.o tls.o
-OBJS-$(CONFIG_TLS_SECURETRANSPORT_PROTOCOL) += tls_securetransport.o tls.o
+TLS-OBJS-$(CONFIG_GNUTLS) += tls_gnutls.o
+TLS-OBJS-$(CONFIG_OPENSSL) += tls_openssl.o
+TLS-OBJS-$(CONFIG_SECURETRANSPORT) += tls_securetransport.o
+TLS-OBJS-$(CONFIG_SCHANNEL) += tls_schannel.o
+OBJS-$(CONFIG_TLS_PROTOCOL) += tls.o $(TLS-OBJS-yes)
OBJS-$(CONFIG_UDP_PROTOCOL) += udp.o
OBJS-$(CONFIG_UDPLITE_PROTOCOL) += udp.o
OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.o
diff --git a/libavformat/network.c b/libavformat/network.c
index b3987a4d11..6c3d9def3b 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -29,25 +29,29 @@
int ff_tls_init(void)
{
-#if CONFIG_TLS_OPENSSL_PROTOCOL
+#if CONFIG_TLS_PROTOCOL
+#if CONFIG_OPENSSL
int ret;
if ((ret = ff_openssl_init()) < 0)
return ret;
#endif
-#if CONFIG_TLS_GNUTLS_PROTOCOL
+#if CONFIG_GNUTLS
ff_gnutls_init();
#endif
+#endif
return 0;
}
void ff_tls_deinit(void)
{
-#if CONFIG_TLS_OPENSSL_PROTOCOL
+#if CONFIG_TLS_PROTOCOL
+#if CONFIG_OPENSSL
ff_openssl_deinit();
#endif
-#if CONFIG_TLS_GNUTLS_PROTOCOL
+#if CONFIG_GNUTLS
ff_gnutls_deinit();
#endif
+#endif
}
int ff_network_inited_globally;
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index 8d3555ed52..669d74d5a8 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -56,10 +56,7 @@ extern const URLProtocol ff_srtp_protocol;
extern const URLProtocol ff_subfile_protocol;
extern const URLProtocol ff_tee_protocol;
extern const URLProtocol ff_tcp_protocol;
-extern const URLProtocol ff_tls_gnutls_protocol;
-extern const URLProtocol ff_tls_schannel_protocol;
-extern const URLProtocol ff_tls_securetransport_protocol;
-extern const URLProtocol ff_tls_openssl_protocol;
+extern const URLProtocol ff_tls_protocol;
extern const URLProtocol ff_udp_protocol;
extern const URLProtocol ff_udplite_protocol;
extern const URLProtocol ff_unix_protocol;
diff --git a/libavformat/tls.h b/libavformat/tls.h
index 0326ef7924..9c851bf132 100644
--- a/libavformat/tls.h
+++ b/libavformat/tls.h
@@ -26,8 +26,6 @@
#include "url.h"
#include "libavutil/opt.h"
-#define CONFIG_TLS_PROTOCOL (CONFIG_TLS_GNUTLS_PROTOCOL | CONFIG_TLS_OPENSSL_PROTOCOL | CONFIG_TLS_SECURETRANSPORT_PROTOCOL | CONFIG_TLS_SCHANNEL_PROTOCOL)
-
typedef struct TLSShared {
char *ca_file;
int verify;
diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index 5ce6c3d448..7adb4eed56 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -260,7 +260,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const URLProtocol ff_tls_gnutls_protocol = {
+const URLProtocol ff_tls_protocol = {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,
diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
index 38af8a21c0..3108a86f41 100644
--- a/libavformat/tls_openssl.c
+++ b/libavformat/tls_openssl.c
@@ -339,7 +339,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const URLProtocol ff_tls_openssl_protocol = {
+const URLProtocol ff_tls_protocol = {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,
diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
index 9f1c08806f..9a6e0c92e3 100644
--- a/libavformat/tls_schannel.c
+++ b/libavformat/tls_schannel.c
@@ -595,7 +595,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const URLProtocol ff_tls_schannel_protocol = {
+const URLProtocol ff_tls_protocol = {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,
diff --git a/libavformat/tls_securetransport.c b/libavformat/tls_securetransport.c
index bc8a32069e..9958931b0c 100644
--- a/libavformat/tls_securetransport.c
+++ b/libavformat/tls_securetransport.c
@@ -393,7 +393,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-const URLProtocol ff_tls_securetransport_protocol = {
+const URLProtocol ff_tls_protocol = {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,