Commit 4600b061 authored by James Almer's avatar James Almer

Merge commit '61cec5ad'

* commit '61cec5ad':
  tls: Hide backend implementation details from users

Also includes ed434be1
Changes were made to support schannel and securetransport.
Merged-by: 's avatarJames Almer <jamrial@gmail.com>
parents bc98788d 61cec5ad
...@@ -3160,21 +3160,14 @@ rtmpte_protocol_suggest="zlib" ...@@ -3160,21 +3160,14 @@ rtmpte_protocol_suggest="zlib"
rtmpts_protocol_select="ffrtmphttp_protocol https_protocol" rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
rtmpts_protocol_suggest="zlib" rtmpts_protocol_suggest="zlib"
rtp_protocol_select="udp_protocol" rtp_protocol_select="udp_protocol"
schannel_conflict="openssl gnutls"
sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags" sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
sctp_protocol_select="network" sctp_protocol_select="network"
securetransport_conflict="openssl gnutls"
srtp_protocol_select="rtp_protocol srtp" srtp_protocol_select="rtp_protocol srtp"
tcp_protocol_select="network" tcp_protocol_select="network"
tls_gnutls_protocol_conflict="tls_schannel_protocol tls_securetransport_protocol" tls_protocol_deps_any="gnutls openssl schannel securetransport"
tls_gnutls_protocol_deps="gnutls" tls_protocol_select="tcp_protocol"
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"
udp_protocol_select="network" udp_protocol_select="network"
udplite_protocol_select="network" udplite_protocol_select="network"
unix_protocol_deps="sys_un_h" unix_protocol_deps="sys_un_h"
...@@ -3752,6 +3745,9 @@ map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST ...@@ -3752,6 +3745,9 @@ map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; } 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 # Disable all the library-specific components if the library itself
# is disabled, see AVCODEC_LIST and following _LIST variables. # is disabled, see AVCODEC_LIST and following _LIST variables.
......
...@@ -586,10 +586,11 @@ OBJS-$(CONFIG_SRTP_PROTOCOL) += srtpproto.o srtp.o ...@@ -586,10 +586,11 @@ OBJS-$(CONFIG_SRTP_PROTOCOL) += srtpproto.o srtp.o
OBJS-$(CONFIG_SUBFILE_PROTOCOL) += subfile.o OBJS-$(CONFIG_SUBFILE_PROTOCOL) += subfile.o
OBJS-$(CONFIG_TEE_PROTOCOL) += teeproto.o tee_common.o OBJS-$(CONFIG_TEE_PROTOCOL) += teeproto.o tee_common.o
OBJS-$(CONFIG_TCP_PROTOCOL) += tcp.o OBJS-$(CONFIG_TCP_PROTOCOL) += tcp.o
OBJS-$(CONFIG_TLS_GNUTLS_PROTOCOL) += tls_gnutls.o tls.o TLS-OBJS-$(CONFIG_GNUTLS) += tls_gnutls.o
OBJS-$(CONFIG_TLS_OPENSSL_PROTOCOL) += tls_openssl.o tls.o TLS-OBJS-$(CONFIG_OPENSSL) += tls_openssl.o
OBJS-$(CONFIG_TLS_SCHANNEL_PROTOCOL) += tls_schannel.o tls.o TLS-OBJS-$(CONFIG_SECURETRANSPORT) += tls_securetransport.o
OBJS-$(CONFIG_TLS_SECURETRANSPORT_PROTOCOL) += tls_securetransport.o tls.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_UDP_PROTOCOL) += udp.o
OBJS-$(CONFIG_UDPLITE_PROTOCOL) += udp.o OBJS-$(CONFIG_UDPLITE_PROTOCOL) += udp.o
OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.o OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.o
......
...@@ -29,25 +29,29 @@ ...@@ -29,25 +29,29 @@
int ff_tls_init(void) int ff_tls_init(void)
{ {
#if CONFIG_TLS_OPENSSL_PROTOCOL #if CONFIG_TLS_PROTOCOL
#if CONFIG_OPENSSL
int ret; int ret;
if ((ret = ff_openssl_init()) < 0) if ((ret = ff_openssl_init()) < 0)
return ret; return ret;
#endif #endif
#if CONFIG_TLS_GNUTLS_PROTOCOL #if CONFIG_GNUTLS
ff_gnutls_init(); ff_gnutls_init();
#endif
#endif #endif
return 0; return 0;
} }
void ff_tls_deinit(void) void ff_tls_deinit(void)
{ {
#if CONFIG_TLS_OPENSSL_PROTOCOL #if CONFIG_TLS_PROTOCOL
#if CONFIG_OPENSSL
ff_openssl_deinit(); ff_openssl_deinit();
#endif #endif
#if CONFIG_TLS_GNUTLS_PROTOCOL #if CONFIG_GNUTLS
ff_gnutls_deinit(); ff_gnutls_deinit();
#endif #endif
#endif
} }
int ff_network_inited_globally; int ff_network_inited_globally;
......
...@@ -56,10 +56,7 @@ extern const URLProtocol ff_srtp_protocol; ...@@ -56,10 +56,7 @@ extern const URLProtocol ff_srtp_protocol;
extern const URLProtocol ff_subfile_protocol; extern const URLProtocol ff_subfile_protocol;
extern const URLProtocol ff_tee_protocol; extern const URLProtocol ff_tee_protocol;
extern const URLProtocol ff_tcp_protocol; extern const URLProtocol ff_tcp_protocol;
extern const URLProtocol ff_tls_gnutls_protocol; extern const URLProtocol ff_tls_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_udp_protocol; extern const URLProtocol ff_udp_protocol;
extern const URLProtocol ff_udplite_protocol; extern const URLProtocol ff_udplite_protocol;
extern const URLProtocol ff_unix_protocol; extern const URLProtocol ff_unix_protocol;
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#include "url.h" #include "url.h"
#include "libavutil/opt.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 { typedef struct TLSShared {
char *ca_file; char *ca_file;
int verify; int verify;
......
...@@ -260,7 +260,7 @@ static const AVClass tls_class = { ...@@ -260,7 +260,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
}; };
const URLProtocol ff_tls_gnutls_protocol = { const URLProtocol ff_tls_protocol = {
.name = "tls", .name = "tls",
.url_open2 = tls_open, .url_open2 = tls_open,
.url_read = tls_read, .url_read = tls_read,
......
...@@ -339,7 +339,7 @@ static const AVClass tls_class = { ...@@ -339,7 +339,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
}; };
const URLProtocol ff_tls_openssl_protocol = { const URLProtocol ff_tls_protocol = {
.name = "tls", .name = "tls",
.url_open2 = tls_open, .url_open2 = tls_open,
.url_read = tls_read, .url_read = tls_read,
......
...@@ -595,7 +595,7 @@ static const AVClass tls_class = { ...@@ -595,7 +595,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
}; };
const URLProtocol ff_tls_schannel_protocol = { const URLProtocol ff_tls_protocol = {
.name = "tls", .name = "tls",
.url_open2 = tls_open, .url_open2 = tls_open,
.url_read = tls_read, .url_read = tls_read,
......
...@@ -393,7 +393,7 @@ static const AVClass tls_class = { ...@@ -393,7 +393,7 @@ static const AVClass tls_class = {
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
}; };
const URLProtocol ff_tls_securetransport_protocol = { const URLProtocol ff_tls_protocol = {
.name = "tls", .name = "tls",
.url_open2 = tls_open, .url_open2 = tls_open,
.url_read = tls_read, .url_read = tls_read,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment