FFmpeg
Data Structures | Macros | Functions | Variables
tls_schannel.c File Reference
#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>

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
 

Functions

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_shutdown_client (URLContext *h)
 
static int tls_close (URLContext *h)
 
static int tls_client_handshake_loop (URLContext *h, int initial)
 
static int tls_client_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)
 

Variables

static const AVOption options []
 
static const AVClass tls_class
 
const URLProtocol ff_tls_protocol
 

Macro Definition Documentation

◆ SECURITY_WIN32

#define SECURITY_WIN32

Based on the CURL SChannel module.

Definition at line 30 of file tls_schannel.c.

◆ SCHANNEL_INITIAL_BUFFER_SIZE

#define SCHANNEL_INITIAL_BUFFER_SIZE   4096

Definition at line 35 of file tls_schannel.c.

◆ SCHANNEL_FREE_BUFFER_SIZE

#define SCHANNEL_FREE_BUFFER_SIZE   1024

Definition at line 36 of file tls_schannel.c.

◆ SECBUFFER_ALERT

#define SECBUFFER_ALERT   17

Definition at line 40 of file tls_schannel.c.

Function Documentation

◆ init_sec_buffer()

static void init_sec_buffer ( SecBuffer *  buffer,
unsigned long  type,
void *  data,
unsigned long  size 
)
static

◆ init_sec_buffer_desc()

static void init_sec_buffer_desc ( SecBufferDesc *  desc,
SecBuffer *  buffers,
unsigned long  buffer_count 
)
static

◆ tls_shutdown_client()

static int tls_shutdown_client ( URLContext h)
static

Definition at line 87 of file tls_schannel.c.

Referenced by tls_close().

◆ tls_close()

static int tls_close ( URLContext h)
static

Definition at line 126 of file tls_schannel.c.

Referenced by tls_open().

◆ tls_client_handshake_loop()

static int tls_client_handshake_loop ( URLContext h,
int  initial 
)
static

Definition at line 146 of file tls_schannel.c.

Referenced by tls_client_handshake(), and tls_read().

◆ tls_client_handshake()

static int tls_client_handshake ( URLContext h)
static

Definition at line 294 of file tls_schannel.c.

Referenced by tls_open().

◆ tls_open()

static int tls_open ( URLContext h,
const char *  uri,
int  flags,
AVDictionary **  options 
)
static

Definition at line 334 of file tls_schannel.c.

◆ tls_read()

static int tls_read ( URLContext h,
uint8_t buf,
int  len 
)
static

Definition at line 385 of file tls_schannel.c.

◆ tls_write()

static int tls_write ( URLContext h,
const uint8_t buf,
int  len 
)
static

Definition at line 528 of file tls_schannel.c.

◆ tls_get_file_handle()

static int tls_get_file_handle ( URLContext h)
static

Definition at line 587 of file tls_schannel.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ NULL }
}

Definition at line 593 of file tls_schannel.c.

Referenced by tls_open().

◆ tls_class

const AVClass tls_class
static
Initial value:
= {
.class_name = "tls",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 598 of file tls_schannel.c.

◆ ff_tls_protocol

const URLProtocol ff_tls_protocol
Initial value:
= {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,
.url_write = tls_write,
.url_close = tls_close,
.url_get_file_handle = tls_get_file_handle,
.priv_data_size = sizeof(TLSContext),
.priv_data_class = &tls_class,
}

Definition at line 605 of file tls_schannel.c.

TLSContext
Definition: tls_gnutls.c:48
URL_PROTOCOL_FLAG_NETWORK
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:34
options
static const AVOption options[]
Definition: tls_schannel.c:593
tls_class
static const AVClass tls_class
Definition: tls_schannel.c:598
tls_write
static int tls_write(URLContext *h, const uint8_t *buf, int len)
Definition: tls_schannel.c:528
TLS_COMMON_OPTIONS
#define TLS_COMMON_OPTIONS(pstruct, options_field)
Definition: tls.h:45
tls_open
static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **options)
Definition: tls_schannel.c:334
tls_read
static int tls_read(URLContext *h, uint8_t *buf, int len)
Definition: tls_schannel.c:385
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
tls_close
static int tls_close(URLContext *h)
Definition: tls_schannel.c:126
tls_get_file_handle
static int tls_get_file_handle(URLContext *h)
Definition: tls_schannel.c:587
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565