xine-lib: xine-lib-1.2.13/src/input/tls/tls_openssl.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Functions | Variables
tls_openssl.c File Reference
`#include <stdlib.h>`
`#include <pthread.h>`
`#include <openssl/bio.h>`
`#include <openssl/ssl.h>`
`#include <openssl/err.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/io_helper.h>`
`#include <xine/xine_plugin.h>`
`#include "xine_tls_plugin.h"`

## Data Structures
struct | tls_openssl_t
struct | openssl_class_t

## Macros
#define | LOG_MODULE "openssl"

## Functions
static int | _bio_read (BIO *b, char *buf, int len)
static int | _bio_write (BIO *b, const char *buf, int len)
static int | _bio_puts (BIO *b, const char *str)
static long | _bio_ctrl (BIO *b, int cmd, long num, void *ptr)
static int | _bio_create (BIO *b)
static int | _bio_destroy (BIO *b)
static BIO * | _bio_new (tls_openssl_t *this)
static ssize_t | _openssl_write (tls_plugin_t *this_gen, const void *buf, size_t len)
static ssize_t | _openssl_read (tls_plugin_t *this_gen, void *buf, size_t len)
static ssize_t | _openssl_part_read (tls_plugin_t *this_gen, void *buf, size_t min, size_t max)
static void | _openssl_shutdown (tls_plugin_t *this_gen)
static int | _openssl_handshake (tls_plugin_t *this_gen, const char *host, int verify)
static void | _openssl_dispose (xine_module_t *this_gen)
static xine_module_t * | _openssl_get_instance (xine_module_class_t *cls_gen, const void *params_gen)
static void | _openssl_class_dispose (xine_module_class_t *cls_gen)
static void * | _openssl_init_class (xine_t *xine, const void *data)

## Variables
static const xine_module_info_t | module_info_openssl
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ LOG_MODULE

#define LOG_MODULE "openssl"

Referenced by _openssl_handshake(), _openssl_part_read(), _openssl_read(), and _openssl_write().

## Function Documentation

## ◆ _bio_create()

static int _bio_create | ( | BIO * | b | ) |
| static

References NULL.

Referenced by _bio_new().

## ◆ _bio_ctrl()

static long _bio_ctrl | ( | BIO * | b,
|  | int | cmd,
|  | long | num,
|  | void * | ptr )
| static

Referenced by _bio_new().

## ◆ _bio_destroy()

static int _bio_destroy | ( | BIO * | b | ) |
| static

Referenced by _bio_new().

## ◆ _bio_new()

static BIO * _bio_new | ( | tls_openssl_t * | this | ) |
| static

References _bio_create(), _bio_ctrl(), _bio_destroy(), _bio_puts(), _bio_read(), _bio_write(), _x_assert, and NULL.

Referenced by _openssl_handshake().

## ◆ _bio_puts()

static int _bio_puts | ( | BIO * | b,
|  | const char * | str )
| static

References _bio_write().

Referenced by _bio_new().

## ◆ _bio_read()

static int _bio_read | ( | BIO * | b,
|  | char * | buf,
|  | int | len )
| static

References _x_io_tcp_read().

Referenced by _bio_new().

## ◆ _bio_write()

static int _bio_write | ( | BIO * | b,
|  | const char * | buf,
|  | int | len )
| static

References _x_io_tcp_write().

Referenced by _bio_new(), and _bio_puts().

## ◆ _openssl_class_dispose()

static void _openssl_class_dispose | ( | xine_module_class_t * | cls_gen | ) |
| static

References openssl_class_t::lock.

Referenced by _openssl_init_class().

## ◆ _openssl_dispose()

static void _openssl_dispose | ( | xine_module_t * | this_gen | ) |
| static

References _openssl_shutdown().

Referenced by _openssl_get_instance().

## ◆ _openssl_get_instance()

static xine_module_t * _openssl_get_instance | ( | xine_module_class_t * | cls_gen,
|  | const void * | params_gen )
| static

References _openssl_dispose(), _openssl_handshake(), _openssl_part_read(), _openssl_read(), _openssl_shutdown(), _openssl_write(), tls_plugin_params_t::fd, openssl_class_t::inited, openssl_class_t::lock, NULL, tls_plugin_params_t::stream, and tls_plugin_params_t::xine.

Referenced by _openssl_init_class().

## ◆ _openssl_handshake()

static int _openssl_handshake | ( | tls_plugin_t * | this_gen,
|  | const char * | host,
|  | int | verify )
| static

References _bio_new(), _openssl_shutdown(), _x_assert, LOG_MODULE, NULL, tls_get_verify_tls_cert(), XINE_VERBOSITY_LOG, and xprintf.

Referenced by _openssl_get_instance().

## ◆ _openssl_init_class()

static void * _openssl_init_class | ( | xine_t * | xine,
|  | const void * | data )
| static

References _openssl_class_dispose(), _openssl_get_instance(), xine_s::config, N_, NULL, and tls_register_config_keys().

## ◆ _openssl_part_read()

static ssize_t _openssl_part_read | ( | tls_plugin_t * | this_gen,
|  | void * | buf,
|  | size_t | min,
|  | size_t | max )
| static

References LOG_MODULE, NULL, XINE_VERBOSITY_LOG, and xprintf.

Referenced by _openssl_get_instance().

## ◆ _openssl_read()

static ssize_t _openssl_read | ( | tls_plugin_t * | this_gen,
|  | void * | buf,
|  | size_t | len )
| static

References LOG_MODULE, NULL, XINE_VERBOSITY_LOG, and xprintf.

Referenced by _openssl_get_instance().

## ◆ _openssl_shutdown()

static void _openssl_shutdown | ( | tls_plugin_t * | this_gen | ) |
| static

References NULL.

Referenced by _openssl_dispose(), _openssl_get_instance(), and _openssl_handshake().

## ◆ _openssl_write()

static ssize_t _openssl_write | ( | tls_plugin_t * | this_gen,
|  | const void * | buf,
|  | size_t | len )
| static

References LOG_MODULE, NULL, XINE_VERBOSITY_LOG, and xprintf.

Referenced by _openssl_get_instance().

## Variable Documentation

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_XINE_MODULE, 1, "openssl", XINE_VERSION_CODE, &module_info_openssl, _openssl_init_class },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
module_info_openssl
static const xine_module_info_t module_info_openssl
Definition tls_openssl.c:371
_openssl_init_class
static void * _openssl_init_class(xine_t *xine, const void *data)
Definition tls_openssl.c:345
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition xine_internal.h:57
NULL
NULL
Definition xine_plugin.c:78
PLUGIN_NONE
#define PLUGIN_NONE
Definition xine_plugin.h:29
PLUGIN_XINE_MODULE
#define PLUGIN_XINE_MODULE
Definition xine_plugin.h:41

## ◆ module_info_openssl

const xine_module_info_t module_info_openssl
| static

Initial value:
= {
.priority = 5,
.type = "tls_v1",
}