Tor 0.4.9.2-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
tortls_internal.h
Go to the documentation of this file.
1/* Copyright (c) 2003, Roger Dingledine
2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3 * Copyright (c) 2007-2021, The Tor Project, Inc. */
4/* See LICENSE for licensing information */
5
6/**
7 * @file tortls_internal.h
8 * @brief Declare internal functions for lib/tls
9 **/
10
11#ifndef TORTLS_INTERNAL_H
12#define TORTLS_INTERNAL_H
13
14#include "lib/tls/x509.h"
15
16int tor_errno_to_tls_error(int e);
17#ifdef ENABLE_OPENSSL
18int tor_tls_get_error(tor_tls_t *tls, int r, int extra,
19 const char *doing, int severity, int domain);
20#endif
21
23 unsigned int key_lifetime, unsigned flags, int is_client);
25 crypto_pk_t *identity,
26 unsigned int key_lifetime,
27 unsigned int flags,
28 int is_client);
30 crypto_pk_t *identity,
31 unsigned key_lifetime,
32 unsigned flags);
33void tor_tls_impl_free_(tor_tls_impl_t *ssl);
34#define tor_tls_impl_free(tls) \
35 FREE_AND_NULL(tor_tls_impl_t, tor_tls_impl_free_, (tls))
36
37void tor_tls_context_impl_free_(tor_tls_context_impl_t *);
38#define tor_tls_context_impl_free(ctx) \
39 FREE_AND_NULL(tor_tls_context_impl_t, tor_tls_context_impl_free_, (ctx))
40
41#ifdef ENABLE_OPENSSL
42tor_tls_t *tor_tls_get_by_ssl(const struct ssl_st *ssl);
43void tor_tls_debug_state_callback(const struct ssl_st *ssl,
44 int type, int val);
45void tor_tls_server_info_callback(const struct ssl_st *ssl,
46 int type, int val);
47void tor_tls_allocate_tor_tls_object_ex_data_index(void);
48
49#ifdef TORTLS_OPENSSL_PRIVATE
50int always_accept_verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx);
51#endif /* defined(TORTLS_OPENSSL_PRIVATE) */
52#endif /* defined(ENABLE_OPENSSL) */
53
54#ifdef TOR_UNIT_TESTS
55extern int tor_tls_object_ex_data_index;
57extern tor_tls_context_t *client_tls_context;
58extern uint16_t v2_cipher_list[];
59extern uint64_t total_bytes_written_over_tls;
60extern uint64_t total_bytes_written_by_tls;
61#endif /* defined(TOR_UNIT_TESTS) */
62
63#endif /* !defined(TORTLS_INTERNAL_H) */
STATIC tor_tls_context_t * server_tls_context
Definition: tortls.c:37
int tor_errno_to_tls_error(int e)
Definition: tortls.c:53
int tor_tls_context_init_certificates(tor_tls_context_t *result, crypto_pk_t *identity, unsigned key_lifetime, unsigned flags)
Definition: tortls.c:278
tor_tls_context_t * tor_tls_context_new(crypto_pk_t *identity, unsigned int key_lifetime, unsigned flags, int is_client)
Definition: tortls_nss.c:154
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)
Definition: tortls.c:240
Headers for tortls.c.