#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/pkcs12.h>
#include <openssl/x509v3.h>
#include "common.h"
#include "tls.h"
Include dependency graph for tls_openssl.c:
Go to the source code of this file.
Data Structures | |
struct | tls_connection |
Defines | |
#define | OPENSSL_d2i_TYPE unsigned char ** |
Functions | |
void * | tls_init (const struct tls_config *conf) |
Initialize TLS library. | |
void | tls_deinit (void *ssl_ctx) |
Deinitialize TLS library. | |
int | tls_get_errors (void *ssl_ctx) |
Process pending errors. | |
tls_connection * | tls_connection_init (void *ssl_ctx) |
Initialize a new TLS connection. | |
void | tls_connection_deinit (void *ssl_ctx, struct tls_connection *conn) |
Free TLS connection data. | |
int | tls_connection_established (void *ssl_ctx, struct tls_connection *conn) |
Has the TLS connection been completed? | |
int | tls_connection_shutdown (void *ssl_ctx, struct tls_connection *conn) |
Shutdown TLS connection data. | |
int | tls_global_ca_cert (void *_ssl_ctx, const char *ca_cert) |
Set trusted CA certificate for all TLS connections. | |
int | tls_global_set_verify (void *ssl_ctx, int check_crl) |
Set global certificate verification options. | |
int | tls_connection_set_verify (void *ssl_ctx, struct tls_connection *conn, int verify_peer) |
Set certificate verification options. | |
int | tls_global_client_cert (void *_ssl_ctx, const char *client_cert) |
Set client certificate for all TLS connections. | |
int | tls_global_private_key (void *_ssl_ctx, const char *private_key, const char *private_key_passwd) |
Set private key for all TLS connections. | |
int | tls_connection_get_keys (void *ssl_ctx, struct tls_connection *conn, struct tls_keys *keys) |
Get master key and random data from TLS connection. | |
u8 * | tls_connection_handshake (void *ssl_ctx, struct tls_connection *conn, const u8 *in_data, size_t in_len, size_t *out_len) |
Process TLS handshake (client side). | |
u8 * | tls_connection_server_handshake (void *ssl_ctx, struct tls_connection *conn, const u8 *in_data, size_t in_len, size_t *out_len) |
Process TLS handshake (server side). | |
int | tls_connection_encrypt (void *ssl_ctx, struct tls_connection *conn, const u8 *in_data, size_t in_len, u8 *out_data, size_t out_len) |
Encrypt data into TLS tunnel. | |
int | tls_connection_decrypt (void *ssl_ctx, struct tls_connection *conn, const u8 *in_data, size_t in_len, u8 *out_data, size_t out_len) |
Decrypt data from TLS tunnel. | |
int | tls_connection_resumed (void *ssl_ctx, struct tls_connection *conn) |
Was session resumption used. | |
int | tls_connection_set_anon_dh (void *ssl_ctx, struct tls_connection *conn) |
Configure TLS connection to use anonymous DH. | |
int | tls_get_cipher (void *ssl_ctx, struct tls_connection *conn, char *buf, size_t buflen) |
Get current cipher name. | |
int | tls_connection_enable_workaround (void *ssl_ctx, struct tls_connection *conn) |
Enable TLS workaround options. | |
int | tls_connection_get_failed (void *ssl_ctx, struct tls_connection *conn) |
Get connection failure status. | |
int | tls_connection_get_read_alerts (void *ssl_ctx, struct tls_connection *conn) |
Get connection read alert status. | |
int | tls_connection_get_write_alerts (void *ssl_ctx, struct tls_connection *conn) |
Get connection write alert status. | |
int | tls_connection_set_params (void *tls_ctx, struct tls_connection *conn, const struct tls_connection_params *params) |
Set TLS connection parameters. | |
int | tls_connection_get_keyblock_size (void *tls_ctx, struct tls_connection *conn) |
Get TLS key_block size. |
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file tls_openssl.c.
|
Decrypt data from TLS tunnel.
Definition at line 1902 of file tls_openssl.c. |
|
Free TLS connection data.
Definition at line 902 of file tls_openssl.c. |
|
Enable TLS workaround options.
Definition at line 2019 of file tls_openssl.c. |
|
Encrypt data into TLS tunnel.
Definition at line 1868 of file tls_openssl.c. |
|
Has the TLS connection been completed?
Definition at line 915 of file tls_openssl.c. |
|
Get connection failure status.
Definition at line 2048 of file tls_openssl.c. |
|
Get TLS key_block size.
Definition at line 2130 of file tls_openssl.c. |
|
Get master key and random data from TLS connection.
Definition at line 1730 of file tls_openssl.c. |
|
Get connection read alert status.
Definition at line 2056 of file tls_openssl.c. |
|
Get connection write alert status.
Definition at line 2064 of file tls_openssl.c. |
|
Process TLS handshake (client side).
This function is used during TLS handshake. The first call is done with in_data == NULL and the library is expected to return ClientHello packet. This packet is then send to the server and a response from server is given to TLS library by calling this function again with in_data pointing to the TLS message from the server. If the TLS handshake fails, this function may return NULL. However, if the TLS library has a TLS alert to send out, that should be returned as the output data. In this case, tls_connection_get_failed() must return failure (> 0). tls_connection_established() should return 1 once the TLS handshake has been completed successfully. Definition at line 1753 of file tls_openssl.c. Here is the call graph for this function: |
|
Initialize a new TLS connection.
Definition at line 855 of file tls_openssl.c. |
|
Was session resumption used.
Definition at line 1932 of file tls_openssl.c. |
|
Process TLS handshake (server side).
Definition at line 1817 of file tls_openssl.c. Here is the call graph for this function: |
|
Configure TLS connection to use anonymous DH.
Definition at line 1988 of file tls_openssl.c. |
|
Set TLS connection parameters.
Definition at line 2072 of file tls_openssl.c. Here is the call graph for this function: |
|
Set certificate verification options.
Definition at line 1206 of file tls_openssl.c. |
|
Shutdown TLS connection data.
Definition at line 921 of file tls_openssl.c. |
|
Deinitialize TLS library.
Definition at line 742 of file tls_openssl.c. |
|
Get current cipher name.
Definition at line 2003 of file tls_openssl.c. |
|
Process pending errors.
Definition at line 841 of file tls_openssl.c. Here is the call graph for this function: |
|
Set trusted CA certificate for all TLS connections.
Definition at line 1135 of file tls_openssl.c. Here is the call graph for this function: |
|
Set client certificate for all TLS connections.
Definition at line 1277 of file tls_openssl.c. Here is the call graph for this function: |
|
Set private key for all TLS connections.
Definition at line 1609 of file tls_openssl.c. |
|
Set global certificate verification options.
Definition at line 1160 of file tls_openssl.c. |
|
Initialize TLS library.
Definition at line 698 of file tls_openssl.c. Here is the call graph for this function: |