|
VLC
2.1.0-git
|
This file defines Transport Layer Security API (TLS) in vlc. More...

Go to the source code of this file.
Data Structures | |
| struct | vlc_tls |
| TLS session. More... | |
| struct | vlc_tls_creds |
| TLS credentials (certificate, private and trust settings) More... | |
Macros | |
| #define | tls_Send(a, b, c) (((vlc_tls_t *)a)->sock.pf_send (a, b, c)) |
| #define | tls_Recv(a, b, c) (((vlc_tls_t *)a)->sock.pf_recv (a, b, c)) |
Typedefs | |
| typedef struct vlc_tls | vlc_tls_t |
| typedef struct vlc_tls_sys | vlc_tls_sys_t |
| typedef struct vlc_tls_creds | vlc_tls_creds_t |
| typedef struct vlc_tls_creds_sys | vlc_tls_creds_sys_t |
Functions | |
| vlc_tls_t * | vlc_tls_ClientSessionCreate (vlc_tls_creds_t *, int fd, const char *host, const char *service) |
| Performs client side of TLS handshake through a connected socket, and establishes a secure channel. | |
| vlc_tls_t * | vlc_tls_SessionCreate (vlc_tls_creds_t *, int fd, const char *host) |
| int | vlc_tls_SessionHandshake (vlc_tls_t *, const char *host, const char *serv) |
| void | vlc_tls_SessionDelete (vlc_tls_t *) |
| vlc_tls_creds_t * | vlc_tls_ClientCreate (vlc_object_t *) |
| Allocates TLS credentials for a client. | |
| vlc_tls_creds_t * | vlc_tls_ServerCreate (vlc_object_t *, const char *cert, const char *key) |
| Allocates a whole server's TLS credentials. | |
| void | vlc_tls_Delete (vlc_tls_creds_t *) |
| Releases data allocated with vlc_tls_ClientCreate() or vlc_tls_ServerCreate(). | |
| int | vlc_tls_ServerAddCA (vlc_tls_creds_t *srv, const char *path) |
| Adds one or more certificate authorities from a file. | |
| int | vlc_tls_ServerAddCRL (vlc_tls_creds_t *srv, const char *path) |
| Adds one or more certificate revocation list from a file. | |
This file defines Transport Layer Security API (TLS) in vlc.
| #define tls_Recv | ( | a, | |
| b, | |||
| c | |||
| ) | (((vlc_tls_t *)a)->sock.pf_recv (a, b, c)) |
Referenced by httpd_NetRecv().
| #define tls_Send | ( | a, | |
| b, | |||
| c | |||
| ) | (((vlc_tls_t *)a)->sock.pf_send (a, b, c)) |
Referenced by httpd_NetSend().
| typedef struct vlc_tls_creds_sys vlc_tls_creds_sys_t |
| typedef struct vlc_tls_creds vlc_tls_creds_t |
| typedef struct vlc_tls_sys vlc_tls_sys_t |
| vlc_tls_creds_t* vlc_tls_ClientCreate | ( | vlc_object_t * | obj | ) |
Allocates TLS credentials for a client.
Credentials can be cached and reused across multiple TLS sessions.
References vlc_tls_creds::module, msg_Err, tls_client_load(), unlikely, vlc_custom_create, vlc_module_load, and vlc_object_release.
| vlc_tls_t* vlc_tls_ClientSessionCreate | ( | vlc_tls_creds_t * | crd, |
| int | fd, | ||
| const char * | host, | ||
| const char * | service | ||
| ) |
Performs client side of TLS handshake through a connected socket, and establishes a secure channel.
This is a blocking network operation.
| fd | socket through which to establish the secure channel |
| hostname | expected server name, used both as Server Name Indication and as expected Common Name of the peer certificate |
References pollfd::events, pollfd::fd, mdate(), msg_Err, poll(), POLLIN, POLLOUT, var_InheritInteger, vlc_tls_SessionCreate(), vlc_tls_SessionDelete(), and vlc_tls_SessionHandshake().
| void vlc_tls_Delete | ( | vlc_tls_creds_t * | crd | ) |
Releases data allocated with vlc_tls_ClientCreate() or vlc_tls_ServerCreate().
| srv | TLS server object to be destroyed, or NULL |
References vlc_tls_creds::module, tls_unload(), vlc_module_unload(), and vlc_object_release.
Referenced by httpd_HostCreate(), httpd_HostDelete(), and vlc_https_HostNew().
| int vlc_tls_ServerAddCA | ( | vlc_tls_creds_t * | srv, |
| const char * | path | ||
| ) |
Adds one or more certificate authorities from a file.
References vlc_tls_creds::add_CA.
Referenced by vlc_https_HostNew().
| int vlc_tls_ServerAddCRL | ( | vlc_tls_creds_t * | srv, |
| const char * | path | ||
| ) |
Adds one or more certificate revocation list from a file.
References vlc_tls_creds::add_CRL.
Referenced by vlc_https_HostNew().
| vlc_tls_creds_t* vlc_tls_ServerCreate | ( | vlc_object_t * | obj, |
| const char * | cert_path, | ||
| const char * | key_path | ||
| ) |
Allocates a whole server's TLS credentials.
| cert_path | required (Unicode) path to an x509 certificate, if NULL, anonymous key exchange will be used. |
| key_path | (UTF-8) path to the PKCS private key for the certificate, if NULL; cert_path will be used. |
References vlc_tls_creds::module, msg_Err, tls_server_load(), unlikely, vlc_custom_create, vlc_module_load, and vlc_object_release.
Referenced by vlc_https_HostNew().
| vlc_tls_t* vlc_tls_SessionCreate | ( | vlc_tls_creds_t * | , |
| int | fd, | ||
| const char * | host | ||
| ) |
< No error
References vlc_tls_creds::open, vlc_custom_create, vlc_object_release, and VLC_SUCCESS.
Referenced by httpd_HostThread(), and vlc_tls_ClientSessionCreate().
| void vlc_tls_SessionDelete | ( | vlc_tls_t * | ) |
References vlc_tls_creds::close, vlc_tls::p_parent, and vlc_object_release.
Referenced by httpd_ClientClean(), and vlc_tls_ClientSessionCreate().
| int vlc_tls_SessionHandshake | ( | vlc_tls_t * | , |
| const char * | host, | ||
| const char * | serv | ||
| ) |
References vlc_tls::handshake.
Referenced by httpd_ClientTlsHandshake(), and vlc_tls_ClientSessionCreate().
1.8.1.2