FFmpeg
Data Structures | Macros | Enumerations | Functions
tls.h File Reference
#include "libavutil/bprint.h"
#include "libavutil/opt.h"
#include "url.h"

Go to the source code of this file.

Data Structures

struct  TLSShared
 

Macros

#define MAX_CERTIFICATE_SIZE   8192
 Maximum size limit of a certificate and private key size. More...
 
#define TLS_OPTFL   (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
 
#define TLS_COMMON_OPTIONS(pstruct, options_field)
 

Enumerations

enum  DTLSState { DTLS_STATE_NONE, DTLS_STATE_FINISHED, DTLS_STATE_CLOSED, DTLS_STATE_FAILED }
 

Functions

int ff_tls_open_underlying (TLSShared *c, URLContext *parent, const char *uri, AVDictionary **options)
 
int ff_url_read_all (const char *url, AVBPrint *bp)
 Read all data from the given URL url and store it in the given buffer bp. More...
 
int ff_dtls_set_udp (URLContext *h, URLContext *udp)
 
int ff_dtls_export_materials (URLContext *h, char *dtls_srtp_materials, size_t materials_sz)
 
int ff_dtls_state (URLContext *h)
 
int ff_ssl_read_key_cert (char *key_url, char *cert_url, char *key_buf, size_t key_sz, char *cert_buf, size_t cert_sz, char **fingerprint)
 
int ff_ssl_gen_key_cert (char *key_buf, size_t key_sz, char *cert_buf, size_t cert_sz, char **fingerprint)
 
void ff_gnutls_init (void)
 
void ff_gnutls_deinit (void)
 
int ff_openssl_init (void)
 
void ff_openssl_deinit (void)
 

Macro Definition Documentation

◆ MAX_CERTIFICATE_SIZE

#define MAX_CERTIFICATE_SIZE   8192

Maximum size limit of a certificate and private key size.

Definition at line 34 of file tls.h.

◆ TLS_OPTFL

Definition at line 82 of file tls.h.

◆ TLS_COMMON_OPTIONS

#define TLS_COMMON_OPTIONS (   pstruct,
  options_field 
)
Value:
{"ca_file", "Certificate Authority database file", offsetof(pstruct, options_field . ca_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \
{"cafile", "Certificate Authority database file", offsetof(pstruct, options_field . ca_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \
{"tls_verify", "Verify the peer certificate", offsetof(pstruct, options_field . verify), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = TLS_OPTFL }, \
{"cert_file", "Certificate file", offsetof(pstruct, options_field . cert_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \
{"key_file", "Private key file", offsetof(pstruct, options_field . key_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \
{"listen", "Listen for incoming connections", offsetof(pstruct, options_field . listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = TLS_OPTFL }, \
{"verifyhost", "Verify against a specific hostname", offsetof(pstruct, options_field . host), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \
{"http_proxy", "Set proxy to tunnel through", offsetof(pstruct, options_field . http_proxy), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \
{"use_external_udp", "Use external UDP from muxer or demuxer", offsetof(pstruct, options_field . use_external_udp), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 1, .flags = TLS_OPTFL }, \
{"mtu", "Maximum Transmission Unit", offsetof(pstruct, options_field . mtu), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = TLS_OPTFL}, \
{"fingerprint", "The optional fingerprint for DTLS", offsetof(pstruct, options_field . fingerprint), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL}, \
{"cert_buf", "The optional certificate buffer for DTLS", offsetof(pstruct, options_field . cert_buf), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL}, \
{"key_buf", "The optional private key buffer for DTLS", offsetof(pstruct, options_field . key_buf), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL}

Definition at line 83 of file tls.h.

Enumeration Type Documentation

◆ DTLSState

enum DTLSState
Enumerator
DTLS_STATE_NONE 
DTLS_STATE_FINISHED 
DTLS_STATE_CLOSED 
DTLS_STATE_FAILED 

Definition at line 36 of file tls.h.

Function Documentation

◆ ff_tls_open_underlying()

int ff_tls_open_underlying ( TLSShared c,
URLContext parent,
const char *  uri,
AVDictionary **  options 
)

Definition at line 69 of file tls.c.

Referenced by dtls_start(), ff_tls_open(), and tls_open().

◆ ff_url_read_all()

int ff_url_read_all ( const char *  url,
AVBPrint *  bp 
)

Read all data from the given URL url and store it in the given buffer bp.

Definition at line 153 of file tls.c.

Referenced by ff_ssl_read_key_cert().

◆ ff_dtls_set_udp()

int ff_dtls_set_udp ( URLContext h,
URLContext udp 
)

Definition at line 497 of file tls_openssl.c.

Referenced by dtls_initialize().

◆ ff_dtls_export_materials()

int ff_dtls_export_materials ( URLContext h,
char *  dtls_srtp_materials,
size_t  materials_sz 
)

Definition at line 504 of file tls_openssl.c.

Referenced by setup_srtp().

◆ ff_dtls_state()

int ff_dtls_state ( URLContext h)

Definition at line 519 of file tls_openssl.c.

Referenced by dtls_context_on_state().

◆ ff_ssl_read_key_cert()

int ff_ssl_read_key_cert ( char *  key_url,
char *  cert_url,
char *  key_buf,
size_t  key_sz,
char *  cert_buf,
size_t  cert_sz,
char **  fingerprint 
)

Definition at line 159 of file tls_openssl.c.

Referenced by certificate_key_init().

◆ ff_ssl_gen_key_cert()

int ff_ssl_gen_key_cert ( char *  key_buf,
size_t  key_sz,
char *  cert_buf,
size_t  cert_sz,
char **  fingerprint 
)

Definition at line 381 of file tls_openssl.c.

Referenced by certificate_key_init().

◆ ff_gnutls_init()

void ff_gnutls_init ( void  )

Definition at line 55 of file tls_gnutls.c.

Referenced by ff_tls_init(), and tls_open().

◆ ff_gnutls_deinit()

void ff_gnutls_deinit ( void  )

Definition at line 66 of file tls_gnutls.c.

Referenced by ff_tls_deinit(), and tls_close().

◆ ff_openssl_init()

int ff_openssl_init ( void  )

Definition at line 557 of file tls_openssl.c.

Referenced by ff_tls_init(), and tls_open().

◆ ff_openssl_deinit()

void ff_openssl_deinit ( void  )

Definition at line 587 of file tls_openssl.c.

Referenced by ff_tls_deinit(), and tls_close().

TLS_OPTFL
#define TLS_OPTFL
Definition: tls.h:82
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276