29#ifndef CWIST_SHIM_OPENSSL_SSL_H
30#define CWIST_SHIM_OPENSSL_SSL_H
44typedef struct cwist_mtls_ssl
SSL;
48#define TLS1_2_VERSION 0x0303
49#define TLS1_3_VERSION 0x0304
52#define SSL_ERROR_NONE 0
53#define SSL_ERROR_SSL 1
54#define SSL_ERROR_WANT_READ 2
55#define SSL_ERROR_WANT_WRITE 3
56#define SSL_ERROR_SYSCALL 5
57#define SSL_ERROR_ZERO_RETURN 6
62#define SSL_OP_NO_COMPRESSION 0x0001UL
63#define SSL_OP_NO_RENEGOTIATION 0x0002UL
64#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x0004UL
65#define SSL_OP_NO_TICKET 0x0008UL
66#define SSL_OP_NO_TLSv1 0x0010UL
67#define SSL_OP_NO_TLSv1_1 0x0020UL
68#define SSL_OP_NO_TLSv1_2 0x0040UL
71#define SSL_MODE_AUTO_RETRY 0x0001UL
74#define SSL_SESS_CACHE_SERVER 0x0002L
77#define SSL_FILETYPE_PEM 1
80#define SSL_VERIFY_NONE 0x00
81#define SSL_VERIFY_PEER 0x01
84#define SSL_TLSEXT_ERR_OK 0
85#define SSL_TLSEXT_ERR_NOACK 3
88#define OPENSSL_NPN_NEGOTIATED 1
91#define SSL_load_error_strings() ((void)0)
92#define OpenSSL_add_ssl_algorithms() ((void)0)
93#define EVP_cleanup() ((void)0)
96#define TLS_server_method cwist_mtls_TLS_server_method
97#define TLS_client_method cwist_mtls_TLS_client_method
98#define SSL_CTX_new cwist_mtls_SSL_CTX_new
99#define SSL_CTX_free cwist_mtls_SSL_CTX_free
106#define SSL_CTX_set_min_proto_version cwist_mtls_SSL_CTX_set_min_proto_version
107#define SSL_CTX_set_options cwist_mtls_SSL_CTX_set_options
108#define SSL_CTX_set_mode cwist_mtls_SSL_CTX_set_mode
109#define SSL_CTX_set_cipher_list cwist_mtls_SSL_CTX_set_cipher_list
110#define SSL_CTX_set_ciphersuites cwist_mtls_SSL_CTX_set_ciphersuites
111#define SSL_CTX_use_certificate_chain_file cwist_mtls_SSL_CTX_use_certificate_chain_file
112#define SSL_CTX_use_PrivateKey_file cwist_mtls_SSL_CTX_use_PrivateKey_file
113#define SSL_CTX_check_private_key cwist_mtls_SSL_CTX_check_private_key
114#define SSL_CTX_set_session_cache_mode cwist_mtls_SSL_CTX_set_session_cache_mode
115#define SSL_CTX_sess_set_cache_size cwist_mtls_SSL_CTX_sess_set_cache_size
116#define SSL_CTX_set_session_id_context cwist_mtls_SSL_CTX_set_session_id_context
117#define SSL_CTX_set_timeout cwist_mtls_SSL_CTX_set_timeout
118#define SSL_CTX_set_alpn_select_cb cwist_mtls_SSL_CTX_set_alpn_select_cb
119#define SSL_CTX_set_alpn_protos cwist_mtls_SSL_CTX_set_alpn_protos
120#define SSL_CTX_set_tlsext_ticket_key_cb cwist_mtls_SSL_CTX_set_tlsext_ticket_key_cb
121#define SSL_CTX_get_ex_new_index cwist_mtls_SSL_CTX_get_ex_new_index
122#define SSL_CTX_set_ex_data cwist_mtls_SSL_CTX_set_ex_data
123#define SSL_CTX_get_ex_data cwist_mtls_SSL_CTX_get_ex_data
124#define SSL_CTX_set_verify cwist_mtls_SSL_CTX_set_verify
125#define SSL_CTX_set_default_verify_paths cwist_mtls_SSL_CTX_set_default_verify_paths
126#define SSL_CTX_set1_groups_list cwist_mtls_SSL_CTX_set1_groups_list
141 int (*cb)(
SSL *ssl,
const unsigned char **out,
142 unsigned char *
outlen,
const unsigned char *
in,
143 unsigned int inlen,
void *arg),
147#define SSL_set_alpn_protos cwist_mtls_SSL_set_alpn_protos
149#define SSL_CTX_use_certificate_file cwist_mtls_SSL_CTX_use_certificate_file
151#define SSL_CTX_get_min_proto_version cwist_mtls_SSL_CTX_get_min_proto_version
166#define SSL_new cwist_mtls_SSL_new
167#define SSL_free cwist_mtls_SSL_free
168#define SSL_set_fd cwist_mtls_SSL_set_fd
169#define SSL_accept cwist_mtls_SSL_accept
170#define SSL_connect cwist_mtls_SSL_connect
171#define SSL_read cwist_mtls_SSL_read
172#define SSL_write cwist_mtls_SSL_write
173#define SSL_pending cwist_mtls_SSL_pending
174#define SSL_shutdown cwist_mtls_SSL_shutdown
175#define SSL_get_error cwist_mtls_SSL_get_error
176#define SSL_get_SSL_CTX cwist_mtls_SSL_get_SSL_CTX
177#define SSL_session_reused cwist_mtls_SSL_session_reused
178#define SSL_version cwist_mtls_SSL_version
179#define SSL_get_cipher_name cwist_mtls_SSL_get_cipher_name
180#define SSL_get0_alpn_selected cwist_mtls_SSL_get0_alpn_selected
181#define SSL_set_tlsext_host_name cwist_mtls_SSL_set_tlsext_host_name
201#define SSL_select_next_proto cwist_mtls_SSL_select_next_proto
204 const unsigned char *client,
unsigned int client_len);
mbedTLS TLS backend: EVP subset (HMAC digest tags, AES-256-CBC).
struct cwist_mtls_cipher_ctx EVP_CIPHER_CTX
mbedTLS TLS backend: HMAC subset (HMAC-SHA256, one-shot + streaming).
struct cwist_mtls_hmac_ctx HMAC_CTX
const SSL_METHOD * cwist_mtls_TLS_client_method(void)
int cwist_mtls_SSL_read(SSL *ssl, void *buf, int num)
void cwist_mtls_SSL_free(SSL *ssl)
int cwist_mtls_SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *path, int type)
void cwist_mtls_SSL_CTX_set_tlsext_ticket_key_cb(SSL_CTX *ctx, int(*cb)(SSL *ssl, unsigned char *key_name, unsigned char *iv, EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx, int enc))
int cwist_mtls_SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *path)
struct cwist_mtls_ssl SSL
void cwist_mtls_SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data, unsigned int *len)
int cwist_mtls_SSL_select_next_proto(unsigned char **out, unsigned char *outlen, const unsigned char *server, unsigned int server_len, const unsigned char *client, unsigned int client_len)
int cwist_mtls_SSL_CTX_check_private_key(const SSL_CTX *ctx)
int cwist_mtls_SSL_CTX_get_min_proto_version(const SSL_CTX *ctx)
int cwist_mtls_SSL_CTX_set_ciphersuites(SSL_CTX *ctx, const char *list)
void cwist_mtls_SSL_CTX_set_verify(SSL_CTX *ctx, int mode, void *callback)
int cwist_mtls_SSL_set_fd(SSL *ssl, int fd)
int cwist_mtls_SSL_CTX_set_ex_data(SSL_CTX *ctx, int idx, void *data)
int cwist_mtls_SSL_write(SSL *ssl, const void *buf, int num)
long cwist_mtls_SSL_CTX_set_mode(SSL_CTX *ctx, long mode)
int cwist_mtls_SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *list)
int cwist_mtls_SSL_set_tlsext_host_name(SSL *ssl, const char *name)
const SSL_METHOD * cwist_mtls_TLS_server_method(void)
int cwist_mtls_SSL_CTX_set1_groups_list(SSL_CTX *ctx, const char *groups)
SSL_CTX * cwist_mtls_SSL_get_SSL_CTX(const SSL *ssl)
const char * cwist_mtls_SSL_get_cipher_name(const SSL *ssl)
void * cwist_mtls_SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx)
int cwist_mtls_SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version)
int cwist_mtls_SSL_version(const SSL *ssl)
int cwist_mtls_SSL_CTX_set_default_verify_paths(SSL_CTX *ctx)
int cwist_mtls_SSL_CTX_get_ex_new_index(long argl, void *argp, void *new_func, void *dup_func, void *free_func)
SSL_CTX * cwist_mtls_SSL_CTX_new(const SSL_METHOD *method)
int cwist_mtls_SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *path, int type)
int cwist_mtls_SSL_get_error(const SSL *ssl, int ret)
long cwist_mtls_SSL_CTX_set_session_cache_mode(SSL_CTX *ctx, long mode)
void cwist_mtls_SSL_CTX_free(SSL_CTX *ctx)
int cwist_mtls_SSL_shutdown(SSL *ssl)
struct cwist_mtls_method SSL_METHOD
SSL * cwist_mtls_SSL_new(SSL_CTX *ctx)
long cwist_mtls_SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, unsigned long size)
int cwist_mtls_SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos, unsigned int protos_len)
long cwist_mtls_SSL_CTX_set_options(SSL_CTX *ctx, unsigned long options)
int cwist_mtls_SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx, unsigned int sid_ctx_len)
int cwist_mtls_SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos, unsigned int protos_len)
int cwist_mtls_SSL_connect(SSL *ssl)
int cwist_mtls_SSL_session_reused(const SSL *ssl)
struct cwist_mtls_ctx SSL_CTX
int cwist_mtls_SSL_pending(const SSL *ssl)
int cwist_mtls_SSL_accept(SSL *ssl)
long cwist_mtls_SSL_CTX_set_timeout(SSL_CTX *ctx, long seconds)
void cwist_mtls_SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, int(*cb)(SSL *ssl, const unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg), void *arg)