Skip to content

Commit 33271e6

Browse files
committed
avformat: implement SChannel SSP TLS protocol
not implemented: - listen support - loading of CA or Cert files
1 parent 8dc6e92 commit 33271e6

File tree

5 files changed

+621
-4
lines changed

5 files changed

+621
-4
lines changed

configure

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ External library support:
279279
--enable-opengl enable OpenGL rendering [no]
280280
--enable-openssl enable openssl, needed for https support
281281
if gnutls is not used [no]
282+
--disable-schannel disable SChannel SSP, needed for TLS support on
283+
Windows if openssl and gnutls are not used [autodetect]
282284
--disable-sdl disable sdl [autodetect]
283285
--disable-securetransport disable Secure Transport, needed for TLS support
284286
on OSX if openssl and gnutls are not used [autodetect]
@@ -1444,6 +1446,7 @@ EXTERNAL_LIBRARY_LIST="
14441446
opencl
14451447
opengl
14461448
openssl
1449+
schannel
14471450
sdl
14481451
securetransport
14491452
x11grab
@@ -2730,13 +2733,15 @@ sctp_protocol_deps="struct_sctp_event_subscribe"
27302733
sctp_protocol_select="network"
27312734
srtp_protocol_select="rtp_protocol"
27322735
tcp_protocol_select="network"
2733-
tls_gnutls_protocol_deps="gnutls !tls_securetransport_protocol"
2736+
tls_gnutls_protocol_deps="gnutls !tls_schannel_protocol !tls_securetransport_protocol"
27342737
tls_gnutls_protocol_select="tcp_protocol"
2735-
tls_openssl_protocol_deps="openssl !tls_securetransport_protocol !tls_gnutls_protocol"
2738+
tls_openssl_protocol_deps="openssl !tls_schannel_protocol !tls_securetransport_protocol !tls_gnutls_protocol"
27362739
tls_openssl_protocol_select="tcp_protocol"
2740+
tls_schannel_protocol_deps="schannel"
2741+
tls_schannel_protocol_select="tcp_protocol"
27372742
tls_securetransport_protocol_deps="securetransport"
27382743
tls_securetransport_protocol_select="tcp_protocol"
2739-
tls_protocol_deps_any="tls_securetransport_protocol tls_gnutls_protocol tls_openssl_protocol"
2744+
tls_protocol_deps_any="tls_schannel_protocol tls_securetransport_protocol tls_gnutls_protocol tls_openssl_protocol"
27402745
udp_protocol_select="network"
27412746
udplite_protocol_select="network"
27422747
unix_protocol_deps="sys_un_h"
@@ -5447,6 +5452,15 @@ disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreF
54475452
check_lib2 "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
54485453
enable securetransport; }
54495454

5455+
if ! disabled schannel; then
5456+
check_cc <<EOF && enable schannel && add_extralibs -lSecur32
5457+
#define SECURITY_WIN32
5458+
#include <windows.h>
5459+
#include <Security.h>
5460+
int main(void) { InitializeSecurityContext(NULL, NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL, NULL, NULL); return 0; }
5461+
EOF
5462+
fi
5463+
54505464
makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
54515465
enabled makeinfo \
54525466
&& [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \

libavformat/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ OBJS-$(CONFIG_SUBFILE_PROTOCOL) += subfile.o
531531
OBJS-$(CONFIG_TCP_PROTOCOL) += tcp.o
532532
OBJS-$(CONFIG_TLS_GNUTLS_PROTOCOL) += tls_gnutls.o tls.o
533533
OBJS-$(CONFIG_TLS_OPENSSL_PROTOCOL) += tls_openssl.o tls.o
534+
OBJS-$(CONFIG_TLS_SCHANNEL_PROTOCOL) += tls_schannel.o tls.o
534535
OBJS-$(CONFIG_TLS_SECURETRANSPORT_PROTOCOL) += tls_securetransport.o tls.o
535536
OBJS-$(CONFIG_UDP_PROTOCOL) += udp.o
536537
OBJS-$(CONFIG_UDPLITE_PROTOCOL) += udp.o

libavformat/allformats.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ void av_register_all(void)
383383
REGISTER_PROTOCOL(SRTP, srtp);
384384
REGISTER_PROTOCOL(SUBFILE, subfile);
385385
REGISTER_PROTOCOL(TCP, tcp);
386+
REGISTER_PROTOCOL(TLS_SCHANNEL, tls_schannel);
386387
REGISTER_PROTOCOL(TLS_SECURETRANSPORT, tls_securetransport);
387388
REGISTER_PROTOCOL(TLS_GNUTLS, tls_gnutls);
388389
REGISTER_PROTOCOL(TLS_OPENSSL, tls_openssl);

libavformat/tls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "url.h"
2727
#include "libavutil/opt.h"
2828

29-
#define CONFIG_TLS_PROTOCOL (CONFIG_TLS_GNUTLS_PROTOCOL | CONFIG_TLS_OPENSSL_PROTOCOL | CONFIG_TLS_SECURETRANSPORT_PROTOCOL)
29+
#define CONFIG_TLS_PROTOCOL (CONFIG_TLS_GNUTLS_PROTOCOL | CONFIG_TLS_OPENSSL_PROTOCOL | CONFIG_TLS_SECURETRANSPORT_PROTOCOL | CONFIG_TLS_SCHANNEL_PROTOCOL)
3030

3131
typedef struct TLSShared {
3232
char *ca_file;

0 commit comments

Comments
 (0)