Tor
0.4.9.3-alpha-dev
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerator
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
b
c
d
f
g
h
l
m
n
o
p
r
s
v
Enumerations
a
b
c
d
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
a
b
c
d
e
g
h
i
m
n
o
p
q
r
s
t
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
lib
tls
tortls_st.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
#ifndef TOR_TORTLS_ST_H
7
#define TOR_TORTLS_ST_H
8
9
/**
10
* @file tortls_st.h
11
* @brief Structure declarations for internal TLS types.
12
*
13
* These should generally be treated as opaque outside of the
14
* lib/tls module.
15
**/
16
17
#include "
lib/net/socket.h
"
18
19
#define TOR_TLS_MAGIC 0x71571571
20
21
typedef
enum
{
22
TOR_TLS_ST_HANDSHAKE, TOR_TLS_ST_OPEN, TOR_TLS_ST_GOTCLOSE,
23
TOR_TLS_ST_SENTCLOSE, TOR_TLS_ST_CLOSED, TOR_TLS_ST_RENEGOTIATE,
24
TOR_TLS_ST_BUFFEREVENT
25
} tor_tls_state_t;
26
#define tor_tls_state_bitfield_t ENUM_BF(tor_tls_state_t)
27
28
struct
tor_tls_context_t
{
29
int
refcnt;
30
tor_tls_context_impl_t *ctx;
31
struct
tor_x509_cert_t *my_link_cert;
32
struct
tor_x509_cert_t *my_id_cert;
33
struct
tor_x509_cert_t *my_auth_cert;
34
crypto_pk_t
*link_key;
35
crypto_pk_t
*auth_key;
36
};
28
struct
tor_tls_context_t
{
…
};
37
38
/** Holds a SSL object and its associated data. Members are only
39
* accessed from within tortls.c.
40
*/
41
struct
tor_tls_t
{
42
uint32_t magic;
43
tor_tls_context_t
*context;
/** A link to the context object for this tls. */
44
tor_tls_impl_t *
ssl
;
/**< An OpenSSL SSL object or NSS PRFileDesc. */
45
tor_socket_t
socket
;
/**< The underlying file descriptor for this TLS
46
* connection. */
47
char
*
address
;
/**< An address to log when describing this connection. */
48
tor_tls_state_bitfield_t
state
: 3;
/**< The current SSL state,
49
* depending on which operations
50
* have completed successfully. */
51
unsigned
int
isServer
:1;
/**< True iff this is a server-side connection */
52
#ifdef ENABLE_OPENSSL
53
size_t
wantwrite_n;
/**< 0 normally, >0 if we returned wantwrite last
54
* time. */
55
/** Last values retrieved from BIO_number_read()/write(); see
56
* tor_tls_get_n_raw_bytes() for usage.
57
*/
58
unsigned
long
last_write_count;
59
unsigned
long
last_read_count;
60
/** Most recent error value from ERR_get_error(). */
61
unsigned
long
last_error;
62
/** If set, a callback to invoke whenever the client tries to renegotiate
63
* the handshake. */
64
void (*negotiated_callback)(
tor_tls_t
*tls,
void
*arg);
65
/** Argument to pass to negotiated_callback. */
66
void
*callback_arg;
67
#endif
/* defined(ENABLE_OPENSSL) */
68
#ifdef ENABLE_NSS
69
/** Last values retried from tor_get_prfiledesc_byte_counts(). */
70
uint64_t last_write_count;
71
uint64_t last_read_count;
72
long
last_error;
73
#endif
/* defined(ENABLE_NSS) */
74
};
41
struct
tor_tls_t
{
…
};
75
76
#endif
/* !defined(TOR_TORTLS_ST_H) */
tor_socket_t
#define tor_socket_t
Definition
nettypes.h:36
socket.h
Header for socket.c.
crypto_pk_t
Definition
crypto_rsa_nss.c:39
tor_tls_context_t
Definition
tortls_st.h:28
tor_tls_t
Definition
tortls_st.h:41
tor_tls_t::state
tor_tls_state_bitfield_t state
Definition
tortls_st.h:48
tor_tls_t::isServer
unsigned int isServer
Definition
tortls_st.h:51
tor_tls_t::address
char * address
Definition
tortls_st.h:47
tor_tls_t::ssl
tor_tls_impl_t * ssl
Definition
tortls_st.h:44
tor_tls_t::socket
tor_socket_t socket
Definition
tortls_st.h:45
Generated by
1.9.8