11 #ifndef TORTLS_INTERNAL_H
12 #define TORTLS_INTERNAL_H
18 int tor_tls_get_error(
tor_tls_t *tls,
int r,
int extra,
19 const char *doing,
int severity,
int domain);
21 MOCK_DECL(
void, try_to_extract_certs_from_tls,
23 tor_x509_cert_impl_t **cert_out,
24 tor_x509_cert_impl_t **id_cert_out));
27 unsigned int key_lifetime,
unsigned flags,
int is_client);
30 unsigned int key_lifetime,
35 unsigned key_lifetime,
37 void tor_tls_impl_free_(tor_tls_impl_t *ssl);
38 #define tor_tls_impl_free(tls) \
39 FREE_AND_NULL(tor_tls_impl_t, tor_tls_impl_free_, (tls))
41 void tor_tls_context_impl_free_(tor_tls_context_impl_t *);
42 #define tor_tls_context_impl_free(ctx) \
43 FREE_AND_NULL(tor_tls_context_impl_t, tor_tls_context_impl_free_, (ctx))
46 tor_tls_t *tor_tls_get_by_ssl(
const struct ssl_st *ssl);
47 int tor_tls_client_is_using_v2_ciphers(
const struct ssl_st *ssl);
48 void tor_tls_debug_state_callback(
const struct ssl_st *ssl,
50 void tor_tls_server_info_callback(
const struct ssl_st *ssl,
52 void tor_tls_allocate_tor_tls_object_ex_data_index(
void);
54 #if !defined(HAVE_SSL_SESSION_GET_MASTER_KEY)
55 size_t SSL_SESSION_get_master_key(
struct ssl_session_st *s,
60 #ifdef TORTLS_OPENSSL_PRIVATE
61 int always_accept_verify_cb(
int preverify_ok, X509_STORE_CTX *x509_ctx);
62 int tor_tls_classify_client_ciphers(
const struct ssl_st *ssl,
63 STACK_OF(SSL_CIPHER) *peer_ciphers);
64 STATIC int tor_tls_session_secret_cb(
struct ssl_st *ssl,
void *secret,
66 STACK_OF(SSL_CIPHER) *peer_ciphers,
67 CONST_IF_OPENSSL_1_1_API SSL_CIPHER **cipher,
69 STATIC int find_cipher_by_id(
const SSL *ssl,
const SSL_METHOD *m,
75 extern int tor_tls_object_ex_data_index;
78 extern uint16_t v2_cipher_list[];
79 extern uint64_t total_bytes_written_over_tls;
80 extern uint64_t total_bytes_written_by_tls;
#define MOCK_DECL(rv, funcname, arglist)
STATIC tor_tls_context_t * server_tls_context
int tor_errno_to_tls_error(int e)
int tor_tls_context_init_certificates(tor_tls_context_t *result, crypto_pk_t *identity, unsigned key_lifetime, unsigned flags)
tor_tls_context_t * tor_tls_context_new(crypto_pk_t *identity, unsigned int key_lifetime, unsigned flags, int is_client)
int tor_tls_context_init_one(tor_tls_context_t **ppcontext, crypto_pk_t *identity, unsigned int key_lifetime, unsigned int flags, int is_client)