Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
62f5c9d6
Commit
62f5c9d6
authored
Apr 21, 2018
by
Thomas Volkert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavformat: add mbedTLS based TLS
parent
2442cf36
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
10 deletions
+85
-10
Changelog
Changelog
+1
-0
configure
configure
+22
-9
Makefile
libavformat/Makefile
+1
-0
rtmpdh.c
libavformat/rtmpdh.c
+55
-0
rtmpdh.h
libavformat/rtmpdh.h
+5
-0
tls_mbedtls.c
libavformat/tls_mbedtls.c
+0
-0
version.h
libavformat/version.h
+1
-1
No files found.
Changelog
View file @
62f5c9d6
...
@@ -3,6 +3,7 @@ releases are sorted from youngest to oldest.
...
@@ -3,6 +3,7 @@ releases are sorted from youngest to oldest.
version <next>:
version <next>:
- deblock filter
- deblock filter
- support mbedTLS based TLS
version 4.0:
version 4.0:
...
...
configure
View file @
62f5c9d6
...
@@ -213,7 +213,7 @@ External library support:
...
@@ -213,7 +213,7 @@ External library support:
--enable-gmp enable gmp, needed for rtmp(t)e support
--enable-gmp enable gmp, needed for rtmp(t)e support
if openssl or librtmp is not used [no]
if openssl or librtmp is not used [no]
--enable-gnutls enable gnutls, needed for https support
--enable-gnutls enable gnutls, needed for https support
if openssl
or lib
tls is not used [no]
if openssl
, libtls or mbed
tls is not used [no]
--disable-iconv disable iconv [autodetect]
--disable-iconv disable iconv [autodetect]
--enable-jni enable JNI support [no]
--enable-jni enable JNI support [no]
--enable-ladspa enable LADSPA audio filtering [no]
--enable-ladspa enable LADSPA audio filtering [no]
...
@@ -262,7 +262,7 @@ External library support:
...
@@ -262,7 +262,7 @@ External library support:
--enable-libtesseract enable Tesseract, needed for ocr filter [no]
--enable-libtesseract enable Tesseract, needed for ocr filter [no]
--enable-libtheora enable Theora encoding via libtheora [no]
--enable-libtheora enable Theora encoding via libtheora [no]
--enable-libtls enable LibreSSL (via libtls), needed for https support
--enable-libtls enable LibreSSL (via libtls), needed for https support
if openssl
or gnu
tls is not used [no]
if openssl
, gnutls or mbed
tls is not used [no]
--enable-libtwolame enable MP2 encoding via libtwolame [no]
--enable-libtwolame enable MP2 encoding via libtwolame [no]
--enable-libv4l2 enable libv4l2/v4l-utils [no]
--enable-libv4l2 enable libv4l2/v4l-utils [no]
--enable-libvidstab enable video stabilization using vid.stab [no]
--enable-libvidstab enable video stabilization using vid.stab [no]
...
@@ -290,13 +290,15 @@ External library support:
...
@@ -290,13 +290,15 @@ External library support:
--disable-lzma disable lzma [autodetect]
--disable-lzma disable lzma [autodetect]
--enable-decklink enable Blackmagic DeckLink I/O support [no]
--enable-decklink enable Blackmagic DeckLink I/O support [no]
--enable-libndi_newtek enable Newteck NDI I/O support [no]
--enable-libndi_newtek enable Newteck NDI I/O support [no]
--enable-mbedtls enable mbedTLS, needed for https support
if openssl, gnutls or libtls is not used [no]
--enable-mediacodec enable Android MediaCodec support [no]
--enable-mediacodec enable Android MediaCodec support [no]
--enable-libmysofa enable libmysofa, needed for sofalizer filter [no]
--enable-libmysofa enable libmysofa, needed for sofalizer filter [no]
--enable-openal enable OpenAL 1.1 capture support [no]
--enable-openal enable OpenAL 1.1 capture support [no]
--enable-opencl enable OpenCL processing [no]
--enable-opencl enable OpenCL processing [no]
--enable-opengl enable OpenGL rendering [no]
--enable-opengl enable OpenGL rendering [no]
--enable-openssl enable openssl, needed for https support
--enable-openssl enable openssl, needed for https support
if gnutls
or lib
tls is not used [no]
if gnutls
, libtls or mbed
tls is not used [no]
--disable-sndio disable sndio support [autodetect]
--disable-sndio disable sndio support [autodetect]
--disable-schannel disable SChannel SSP, needed for TLS support on
--disable-schannel disable SChannel SSP, needed for TLS support on
Windows if openssl and gnutls are not used [autodetect]
Windows if openssl and gnutls are not used [autodetect]
...
@@ -1654,6 +1656,7 @@ EXTERNAL_LIBRARY_VERSION3_LIST="
...
@@ -1654,6 +1656,7 @@ EXTERNAL_LIBRARY_VERSION3_LIST="
libopencore_amrwb
libopencore_amrwb
libvmaf
libvmaf
libvo_amrwbenc
libvo_amrwbenc
mbedtls
rkmpp
rkmpp
"
"
...
@@ -3117,7 +3120,7 @@ fifo_muxer_deps="threads"
...
@@ -3117,7 +3120,7 @@ fifo_muxer_deps="threads"
flac_demuxer_select
=
"flac_parser"
flac_demuxer_select
=
"flac_parser"
hds_muxer_select
=
"flv_muxer"
hds_muxer_select
=
"flv_muxer"
hls_muxer_select
=
"mpegts_muxer"
hls_muxer_select
=
"mpegts_muxer"
hls_muxer_suggest
=
"gcrypt openssl"
hls_muxer_suggest
=
"gcrypt openssl
mbedtls
"
image2_alias_pix_demuxer_select
=
"image2_demuxer"
image2_alias_pix_demuxer_select
=
"image2_demuxer"
image2_brender_pix_demuxer_select
=
"image2_demuxer"
image2_brender_pix_demuxer_select
=
"image2_demuxer"
ipod_muxer_select
=
"mov_muxer"
ipod_muxer_select
=
"mov_muxer"
...
@@ -3229,7 +3232,7 @@ xv_outdev_extralibs="-lXv -lX11 -lXext"
...
@@ -3229,7 +3232,7 @@ xv_outdev_extralibs="-lXv -lX11 -lXext"
async_protocol_deps
=
"threads"
async_protocol_deps
=
"threads"
bluray_protocol_deps
=
"libbluray"
bluray_protocol_deps
=
"libbluray"
ffrtmpcrypt_protocol_conflict
=
"librtmp_protocol"
ffrtmpcrypt_protocol_conflict
=
"librtmp_protocol"
ffrtmpcrypt_protocol_deps_any
=
"gcrypt gmp openssl"
ffrtmpcrypt_protocol_deps_any
=
"gcrypt gmp openssl
mbedtls
"
ffrtmpcrypt_protocol_select
=
"tcp_protocol"
ffrtmpcrypt_protocol_select
=
"tcp_protocol"
ffrtmphttp_protocol_conflict
=
"librtmp_protocol"
ffrtmphttp_protocol_conflict
=
"librtmp_protocol"
ffrtmphttp_protocol_select
=
"http_protocol"
ffrtmphttp_protocol_select
=
"http_protocol"
...
@@ -3249,7 +3252,7 @@ librtmpt_protocol_deps="librtmp"
...
@@ -3249,7 +3252,7 @@ librtmpt_protocol_deps="librtmp"
librtmpte_protocol_deps
=
"librtmp"
librtmpte_protocol_deps
=
"librtmp"
libsmbclient_protocol_deps
=
"libsmbclient gplv3"
libsmbclient_protocol_deps
=
"libsmbclient gplv3"
libssh_protocol_deps
=
"libssh"
libssh_protocol_deps
=
"libssh"
libtls_conflict
=
"openssl gnutls"
libtls_conflict
=
"openssl gnutls
mbedtls
"
mmsh_protocol_select
=
"http_protocol"
mmsh_protocol_select
=
"http_protocol"
mmst_protocol_select
=
"network"
mmst_protocol_select
=
"network"
libsrt_protocol_deps
=
"libsrt"
libsrt_protocol_deps
=
"libsrt"
...
@@ -3269,13 +3272,13 @@ rtmpte_protocol_suggest="zlib"
...
@@ -3269,13 +3272,13 @@ 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 libtls"
schannel_conflict
=
"openssl gnutls libtls
mbedtls
"
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 libtls"
securetransport_conflict
=
"openssl gnutls libtls
mbedtls
"
srtp_protocol_select
=
"rtp_protocol srtp"
srtp_protocol_select
=
"rtp_protocol srtp"
tcp_protocol_select
=
"network"
tcp_protocol_select
=
"network"
tls_protocol_deps_any
=
"gnutls openssl schannel securetransport libtls"
tls_protocol_deps_any
=
"gnutls openssl schannel securetransport libtls
mbedtls
"
tls_protocol_select
=
"tcp_protocol"
tls_protocol_select
=
"tcp_protocol"
udp_protocol_select
=
"network"
udp_protocol_select
=
"network"
udplite_protocol_select
=
"network"
udplite_protocol_select
=
"network"
...
@@ -3907,6 +3910,12 @@ fi
...
@@ -3907,6 +3910,12 @@ fi
enabled_all gnutls openssl
&&
enabled_all gnutls openssl
&&
die
"GnuTLS and OpenSSL must not be enabled at the same time."
die
"GnuTLS and OpenSSL must not be enabled at the same time."
enabled_all gnutls mbedtls
&&
die
"GnuTLS and mbedTLS must not be enabled at the same time."
enabled_all openssl mbedtls
&&
die
"OpenSSL and mbedTLS 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.
...
@@ -6090,6 +6099,10 @@ enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_d
...
@@ -6090,6 +6099,10 @@ enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_d
{
test_cpp_condition libzvbi.h
"VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28"
||
{
test_cpp_condition libzvbi.h
"VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28"
||
enabled gpl
||
die
"ERROR: libzvbi requires version 0.2.28 or --enable-gpl."
;
}
enabled gpl
||
die
"ERROR: libzvbi requires version 0.2.28 or --enable-gpl."
;
}
enabled libxml2
&&
require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
enabled libxml2
&&
require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
enabled mbedtls
&&
{
check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init
||
check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init
||
check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init
-lmbedtls
||
die
"ERROR: mbedTLS not found"
;
}
enabled mediacodec
&&
{
enabled jni
||
die
"ERROR: mediacodec requires --enable-jni"
;
}
enabled mediacodec
&&
{
enabled jni
||
die
"ERROR: mediacodec requires --enable-jni"
;
}
enabled mmal
&&
{
check_lib mmal interface/mmal/mmal.h mmal_port_connect
-lmmal_core
-lmmal_util
-lmmal_vc_client
-lbcm_host
||
enabled mmal
&&
{
check_lib mmal interface/mmal/mmal.h mmal_port_connect
-lmmal_core
-lmmal_util
-lmmal_vc_client
-lbcm_host
||
{
!
enabled cross_compile
&&
{
!
enabled cross_compile
&&
...
...
libavformat/Makefile
View file @
62f5c9d6
...
@@ -608,6 +608,7 @@ OBJS-$(CONFIG_TEE_PROTOCOL) += teeproto.o tee_common.o
...
@@ -608,6 +608,7 @@ OBJS-$(CONFIG_TEE_PROTOCOL) += teeproto.o tee_common.o
OBJS-$(CONFIG_TCP_PROTOCOL)
+=
tcp.o
OBJS-$(CONFIG_TCP_PROTOCOL)
+=
tcp.o
TLS-OBJS-$(CONFIG_GNUTLS)
+=
tls_gnutls.o
TLS-OBJS-$(CONFIG_GNUTLS)
+=
tls_gnutls.o
TLS-OBJS-$(CONFIG_LIBTLS)
+=
tls_libtls.o
TLS-OBJS-$(CONFIG_LIBTLS)
+=
tls_libtls.o
TLS-OBJS-$(CONFIG_MBEDTLS)
+=
tls_mbedtls.o
TLS-OBJS-$(CONFIG_OPENSSL)
+=
tls_openssl.o
TLS-OBJS-$(CONFIG_OPENSSL)
+=
tls_openssl.o
TLS-OBJS-$(CONFIG_SECURETRANSPORT)
+=
tls_securetransport.o
TLS-OBJS-$(CONFIG_SECURETRANSPORT)
+=
tls_securetransport.o
TLS-OBJS-$(CONFIG_SCHANNEL)
+=
tls_schannel.o
TLS-OBJS-$(CONFIG_SCHANNEL)
+=
tls_schannel.o
...
...
libavformat/rtmpdh.c
View file @
62f5c9d6
...
@@ -38,6 +38,11 @@
...
@@ -38,6 +38,11 @@
#include "rtmpdh.h"
#include "rtmpdh.h"
#if CONFIG_MBEDTLS
#include <mbedtls/ctr_drbg.h>
#include <mbedtls/entropy.h>
#endif
#define P1024 \
#define P1024 \
"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \
"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \
"29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \
"29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \
...
@@ -159,6 +164,56 @@ static int bn_modexp(FFBigNum bn, FFBigNum y, FFBigNum q, FFBigNum p)
...
@@ -159,6 +164,56 @@ static int bn_modexp(FFBigNum bn, FFBigNum y, FFBigNum q, FFBigNum p)
BN_CTX_free
(
ctx
);
BN_CTX_free
(
ctx
);
return
0
;
return
0
;
}
}
#elif CONFIG_MBEDTLS
#define bn_new(bn) \
do { \
bn = av_malloc(sizeof(*bn)); \
if (bn) \
mbedtls_mpi_init(bn); \
} while (0)
#define bn_free(bn) \
do { \
mbedtls_mpi_free(bn); \
av_free(bn); \
} while (0)
#define bn_set_word(bn, w) mbedtls_mpi_lset(bn, w)
#define bn_cmp(a, b) mbedtls_mpi_cmp_mpi(a, b)
#define bn_copy(to, from) mbedtls_mpi_copy(to, from)
#define bn_sub_word(bn, w) mbedtls_mpi_sub_int(bn, bn, w)
#define bn_cmp_1(bn) mbedtls_mpi_cmp_int(bn, 1)
#define bn_num_bytes(bn) (mbedtls_mpi_bitlen(bn) + 7) / 8
#define bn_bn2bin(bn, buf, len) mbedtls_mpi_write_binary(bn, buf, len)
#define bn_bin2bn(bn, buf, len) \
do { \
bn_new(bn); \
if (bn) \
mbedtls_mpi_read_binary(bn, buf, len); \
} while (0)
#define bn_hex2bn(bn, buf, ret) \
do { \
bn_new(bn); \
if (bn) \
ret = (mbedtls_mpi_read_string(bn, 16, buf) == 0); \
else \
ret = 1; \
} while (0)
#define bn_random(bn, num_bits) \
do { \
mbedtls_entropy_context entropy_ctx; \
mbedtls_ctr_drbg_context ctr_drbg_ctx; \
\
mbedtls_entropy_init(&entropy_ctx); \
mbedtls_ctr_drbg_init(&ctr_drbg_ctx); \
mbedtls_ctr_drbg_seed(&ctr_drbg_ctx, \
mbedtls_entropy_func, \
&entropy_ctx, \
NULL, 0); \
mbedtls_mpi_fill_random(bn, (num_bits + 7) / 8, mbedtls_ctr_drbg_random, &ctr_drbg_ctx); \
mbedtls_ctr_drbg_free(&ctr_drbg_ctx); \
mbedtls_entropy_free(&entropy_ctx); \
} while (0)
#define bn_modexp(bn, y, q, p) mbedtls_mpi_exp_mod(bn, y, q, p, 0)
#endif
#endif
#define MAX_BYTES 18000
#define MAX_BYTES 18000
...
...
libavformat/rtmpdh.h
View file @
62f5c9d6
...
@@ -40,6 +40,11 @@ typedef gcry_mpi_t FFBigNum;
...
@@ -40,6 +40,11 @@ typedef gcry_mpi_t FFBigNum;
#include <openssl/dh.h>
#include <openssl/dh.h>
typedef
BIGNUM
*
FFBigNum
;
typedef
BIGNUM
*
FFBigNum
;
#elif CONFIG_MBEDTLS
#include <mbedtls/bignum.h>
typedef
mbedtls_mpi
*
FFBigNum
;
#endif
#endif
typedef
struct
FF_DH
{
typedef
struct
FF_DH
{
...
...
libavformat/tls_mbedtls.c
0 → 100644
View file @
62f5c9d6
This diff is collapsed.
Click to expand it.
libavformat/version.h
View file @
62f5c9d6
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MINOR 1
3
#define LIBAVFORMAT_VERSION_MINOR 1
4
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment