FFmpeg
|
#include "config.h"
#include "config_components.h"
#include "libavutil/mem.h"
#include "avformat.h"
#include "internal.h"
#include "network.h"
#include "os_support.h"
#include "url.h"
#include "tls.h"
#include <windows.h>
#include <security.h>
#include <schnlsp.h>
#include <sddl.h>
Go to the source code of this file.
Data Structures | |
struct | TLSContext |
Macros | |
#define | SECURITY_WIN32 |
Based on the CURL SChannel module. More... | |
#define | SCHANNEL_INITIAL_BUFFER_SIZE 4096 |
#define | SCHANNEL_FREE_BUFFER_SIZE 1024 |
#define | SECBUFFER_ALERT 17 |
#define | FF_NCRYPT_TEMP_KEY_NAME L"FFMPEG_TEMP_TLS_KEY" |
#define | OFFSET(x) offsetof(TLSContext, x) |
Functions | |
static int | der_to_pem (const char *data, size_t len, const char *header, char *buf, size_t bufsize) |
static int | pem_to_der (const char *pem, char **buf, int *out_len) |
static int | der_to_fingerprint (const char *data, size_t len, char **fingerprint) |
static int | tls_gen_self_signed (NCRYPT_KEY_HANDLE *key, PCCERT_CONTEXT *crtctx) |
static int | tls_export_key_cert (NCRYPT_KEY_HANDLE key, PCCERT_CONTEXT crtctx, 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) |
static int | tls_import_key_cert (char *key_buf, char *cert_buf, NCRYPT_KEY_HANDLE *key, PCCERT_CONTEXT *crtctx) |
static int | tls_cert_from_store (void *logctx, const char *cert_store_name, const char *cert_subj, PCCERT_CONTEXT *crtctx) |
static int | tls_load_key_cert (char *key_url, char *cert_url, NCRYPT_KEY_HANDLE *key, PCCERT_CONTEXT *crtctx) |
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_tls_set_external_socket (URLContext *h, URLContext *sock) |
int | ff_dtls_export_materials (URLContext *h, char *dtls_srtp_materials, size_t materials_sz) |
int | ff_dtls_state (URLContext *h) |
static void | init_sec_buffer (SecBuffer *buffer, unsigned long type, void *data, unsigned long size) |
static void | init_sec_buffer_desc (SecBufferDesc *desc, SecBuffer *buffers, unsigned long buffer_count) |
static int | tls_process_send_buffer (URLContext *h) |
static int | tls_shutdown_client (URLContext *h) |
static int | tls_close (URLContext *h) |
static int | tls_handshake_loop (URLContext *h, int initial) |
static int | tls_client_handshake (URLContext *h) |
static int | tls_server_handshake (URLContext *h) |
static int | tls_handshake (URLContext *h) |
static int | tls_open (URLContext *h, const char *uri, int flags, AVDictionary **options) |
static int | tls_read (URLContext *h, uint8_t *buf, int len) |
static int | tls_write (URLContext *h, const uint8_t *buf, int len) |
static int | tls_get_file_handle (URLContext *h) |
static int | tls_get_short_seek (URLContext *h) |
Variables | |
static const AVOption | options [] |
#define SECURITY_WIN32 |
Based on the CURL SChannel module.
Definition at line 34 of file tls_schannel.c.
#define SCHANNEL_INITIAL_BUFFER_SIZE 4096 |
Definition at line 40 of file tls_schannel.c.
#define SCHANNEL_FREE_BUFFER_SIZE 1024 |
Definition at line 41 of file tls_schannel.c.
#define SECBUFFER_ALERT 17 |
Definition at line 45 of file tls_schannel.c.
#define FF_NCRYPT_TEMP_KEY_NAME L"FFMPEG_TEMP_TLS_KEY" |
Definition at line 61 of file tls_schannel.c.
#define OFFSET | ( | x | ) | offsetof(TLSContext, x) |
Definition at line 1457 of file tls_schannel.c.
|
static |
Definition at line 63 of file tls_schannel.c.
Referenced by tls_export_key_cert().
|
static |
Definition at line 104 of file tls_schannel.c.
Referenced by tls_import_key_cert().
|
static |
Definition at line 127 of file tls_schannel.c.
Referenced by tls_export_key_cert().
|
static |
Definition at line 148 of file tls_schannel.c.
Referenced by ff_ssl_gen_key_cert(), and tls_open().
|
static |
Definition at line 327 of file tls_schannel.c.
Referenced by ff_ssl_gen_key_cert(), and ff_ssl_read_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 373 of file tls_schannel.c.
Referenced by certificate_key_init().
|
static |
Definition at line 396 of file tls_schannel.c.
Referenced by tls_load_key_cert(), and tls_open().
|
static |
Definition at line 508 of file tls_schannel.c.
Referenced by tls_open().
|
static |
Definition at line 534 of file tls_schannel.c.
Referenced by ff_ssl_read_key_cert(), and tls_open().
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 566 of file tls_schannel.c.
Referenced by certificate_key_init().
int ff_tls_set_external_socket | ( | URLContext * | h, |
URLContext * | sock | ||
) |
Definition at line 625 of file tls_schannel.c.
Referenced by dtls_initialize().
int ff_dtls_export_materials | ( | URLContext * | h, |
char * | dtls_srtp_materials, | ||
size_t | materials_sz | ||
) |
Definition at line 638 of file tls_schannel.c.
Referenced by setup_srtp().
int ff_dtls_state | ( | URLContext * | h | ) |
Definition at line 684 of file tls_schannel.c.
Referenced by dtls_context_on_state().
|
static |
Definition at line 690 of file tls_schannel.c.
Referenced by tls_client_handshake(), tls_handshake_loop(), tls_read(), tls_shutdown_client(), and tls_write().
|
static |
Definition at line 698 of file tls_schannel.c.
Referenced by tls_client_handshake(), tls_handshake_loop(), tls_read(), tls_shutdown_client(), and tls_write().
|
static |
Definition at line 706 of file tls_schannel.c.
Referenced by tls_shutdown_client(), and tls_write().
|
static |
Definition at line 735 of file tls_schannel.c.
Referenced by tls_close().
|
static |
Definition at line 796 of file tls_schannel.c.
Referenced by tls_open().
|
static |
Definition at line 825 of file tls_schannel.c.
Referenced by tls_client_handshake(), tls_read(), and tls_server_handshake().
|
static |
Definition at line 1021 of file tls_schannel.c.
Referenced by tls_handshake().
|
static |
Definition at line 1068 of file tls_schannel.c.
Referenced by tls_handshake().
|
static |
Definition at line 1085 of file tls_schannel.c.
Referenced by tls_open().
|
static |
Definition at line 1120 of file tls_schannel.c.
|
static |
Definition at line 1221 of file tls_schannel.c.
|
static |
Definition at line 1375 of file tls_schannel.c.
|
static |
Definition at line 1443 of file tls_schannel.c.
|
static |
Definition at line 1450 of file tls_schannel.c.
Definition at line 1458 of file tls_schannel.c.