OpenVPN
mudp.c
Go to the documentation of this file.
1/*
2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single TCP/UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
6 * packet compression.
7 *
8 * Copyright (C) 2002-2026 OpenVPN Inc <sales@openvpn.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, see <https://www.gnu.org/licenses/>.
21 */
22
23#ifdef HAVE_CONFIG_H
24#include "config.h"
25#endif
26
27#include "syshead.h"
28
29#include "multi.h"
30#include <inttypes.h>
31#include "forward.h"
32
33#include "memdbg.h"
34#include "ssl_pkt.h"
35
36#ifdef HAVE_SYS_INOTIFY_H
37#include <sys/inotify.h>
38#endif
39
55static void
56send_standalone_reply(struct multi_context *m, struct buffer *buf, const char *prefix,
57 const char *detail, struct link_socket *sock)
58{
59 struct context *c = &m->top;
60
61 /* dco-win server requires prepend with sockaddr, so preserve offset */
63 buf_copy(&c->c2.buffers->aux_buf, buf);
64
65 msg_set_prefix(prefix);
66 c->c2.to_link = c->c2.buffers->aux_buf;
67 c->c2.to_link_addr = &c->c2.from;
68 msg(D_MULTI_DEBUG, "%s", detail);
69 process_outgoing_link(c, sock);
70 c->c2.to_link.len = 0;
71 c->c2.to_link_addr = NULL;
72 msg_set_prefix(NULL);
73}
74
75static void
77 struct tls_auth_standalone *tas, struct session_id *sid,
78 bool request_resend_wkc, struct link_socket *sock)
79{
82 uint8_t header = 0 | (P_CONTROL_HARD_RESET_SERVER_V2 << P_OPCODE_SHIFT);
83 struct buffer buf = tls_reset_standalone(&state->tls_wrap_tmp, tas, sid,
84 &state->peer_session_id, header, request_resend_wkc);
85
86 send_standalone_reply(m, &buf, "Connection Attempt",
87 "Reset packet from client, sending HMAC based reset challenge", sock);
88}
89
90
91/* Returns true if this packet should create a new session */
92static bool
94 struct mroute_addr addr, struct link_socket *sock)
95{
96 ASSERT(m->top.c2.tls_auth_standalone);
97
99
101
102 verdict = tls_pre_decrypt_lite(tas, state, &m->top.c2.from, &m->top.c2.buf);
103
104 uint8_t *hmac_key = m->top.c2.session_id_key;
105 struct openvpn_sockaddr *from = &m->top.c2.from.dest;
106 int handwindow = m->top.options.handshake_window;
107
108 if (verdict == VERDICT_VALID_RESET_V3 || verdict == VERDICT_VALID_RESET_V2)
109 {
110 /* Check if we are still below our limit for sending out
111 * responses */
113 {
114 return false;
115 }
116 }
117
118 if (verdict == VERDICT_VALID_RESET_V3)
119 {
120 /* Extract the packet id to check if it has the special format that
121 * indicates early negotiation support */
122 struct packet_id_net pin;
123 struct buffer tmp = m->top.c2.buf;
125 ASSERT(packet_id_read(&pin, &tmp, true));
126
127 /* The most significant byte is 0x0f if early negotiation is supported */
129
130 /* All clients that support early negotiation and tls-crypt are assumed
131 * to also support resending the WKc in the 2nd packet */
133 {
134 /* Calculate the session ID HMAC for our reply and create reset packet */
135 struct session_id sid =
136 calculate_session_id_hmac(state->peer_session_id, from, hmac_key, handwindow, 0);
137 send_hmac_reset_packet(m, state, tas, &sid, true, sock);
138
139 return false;
140 }
141 else
142 {
143 /* For tls-crypt-v2 we need to keep the state of the first packet
144 * to store the unwrapped key if the client doesn't support resending
145 * the wrapped key. Unless the user specifically disallowed
146 * compatibility with such clients to avoid state exhaustion */
148 {
149 struct gc_arena gc = gc_new();
150 const char *peer = print_link_socket_actual(&m->top.c2.from, &gc);
152 "tls-crypt-v2 force-cookie is enabled, "
153 "ignoring connection attempt from old client (%s)",
154 peer);
155 gc_free(&gc);
156 return false;
157 }
158 else
159 {
160 return true;
161 }
162 }
163 }
164 else if (verdict == VERDICT_VALID_RESET_V2)
165 {
166 /* Calculate the session ID HMAC for our reply and create reset packet */
167 struct session_id sid =
168 calculate_session_id_hmac(state->peer_session_id, from, hmac_key, handwindow, 0);
169
170 send_hmac_reset_packet(m, state, tas, &sid, false, sock);
171
172 /* We have a reply do not create a new session */
173 return false;
174 }
175 else if (verdict == VERDICT_VALID_CONTROL_V1 || verdict == VERDICT_VALID_ACK_V1
176 || verdict == VERDICT_VALID_WKC_V1)
177 {
178 /* ACK_V1 contains the peer id (our id) while CONTROL_V1 can but does not
179 * need to contain the peer id */
180 struct gc_arena gc = gc_new();
181
182 bool pkt_is_ack = (verdict == VERDICT_VALID_ACK_V1);
183 bool ret = check_session_hmac_and_pkt_id(state, from, hmac_key, handwindow, pkt_is_ack);
184
185 const char *peer = print_link_socket_actual(&m->top.c2.from, &gc);
186 uint8_t pkt_firstbyte = *BPTR(&m->top.c2.buf);
187 int op = pkt_firstbyte >> P_OPCODE_SHIFT;
188
189 if (!ret)
190 {
191 msg(D_MULTI_MEDIUM, "Packet (%s) with invalid or missing SID from"
192 " %s or wrong packet id",
193 packet_opcode_name(op), peer);
194 }
195 else
196 {
198 "Valid packet (%s) with HMAC challenge from peer (%s), "
199 "accepting new connection.",
200 packet_opcode_name(op), peer);
201 }
202 gc_free(&gc);
203
204 return ret;
205 }
206
207 /* VERDICT_INVALID */
208 return false;
209}
210
218static struct multi_instance *
220 struct link_socket *sock,
221 struct mroute_addr *real)
222{
223 struct hash *hash = m->hash;
224 struct tls_pre_decrypt_state state = { 0 };
225 struct multi_instance *mi = NULL;
226 struct gc_arena gc = gc_new();
227
229 {
231 "MULTI: Connection attempt from %s ignored while server is "
232 "shutting down",
233 mroute_addr_print(real, &gc));
234 }
235 else if (do_pre_decrypt_check(m, &state, *real, sock))
236 {
237 /* This is an unknown session but with valid tls-auth/tls-crypt
238 * (or no auth at all). If this is the initial packet of a
239 * session, we just send a reply with a HMAC session id and
240 * do not generate a session slot */
241
243 {
244 /* a successful three-way handshake only counts against
245 * connect-freq but not against connect-freq-initial */
247
248 mi = multi_create_instance(m, real, sock);
249 if (mi)
250 {
251 const uint64_t hv = hash_value(hash, real);
252 struct hash_bucket *bucket = hash_bucket(hash, hv);
253 hash_add_fast(hash, bucket, &mi->real, hv, mi);
254
255 mi->did_real_hash = true;
257
258 /* If we have a session id already, ensure that the
259 * state is using the same */
262 {
264 struct tls_session *session =
267 }
268 }
269 }
270 else
271 {
273 "MULTI: Connection from %s would exceed new connection frequency limit as controlled by --connect-freq",
274 mroute_addr_print(real, &gc));
275 }
276 }
278 gc_free(&gc);
279 return mi;
280}
281
288static struct multi_instance *
290{
291 struct hash *hash = m->hash;
292 struct hash_element *he;
293 const uint64_t hv = hash_value(hash, real);
294 struct hash_bucket *bucket = hash_bucket(hash, hv);
295 he = hash_lookup_fast(hash, bucket, real, hv);
296 if (he)
297 {
298 return he->value;
299 }
300 return NULL;
301}
302
303struct multi_instance *
305{
306 struct mroute_addr real = { 0 };
307 real.proto = sock->info.proto;
308
309 if (mroute_extract_openvpn_sockaddr(&real, &m->top.c2.from.dest, true) && m->top.c2.buf.len > 0)
310 {
311 return multi_get_instance_udp_real(m, &real);
312 }
313
314 return NULL;
315}
316
322struct multi_instance *
323multi_get_instance_udp_data(struct multi_context *m, bool *floated, struct mroute_addr *real, struct link_socket *sock)
324{
325 struct multi_instance *mi = NULL;
326
327 uint8_t *ptr = BPTR(&m->top.c2.buf);
328 uint8_t op = ptr[0] >> P_OPCODE_SHIFT;
329 bool v2 = (op == P_DATA_V2) && (m->top.c2.buf.len >= (1 + 3));
330 bool peer_id_disabled = false;
331
332 /* make sure buffer has enough length to read opcode (1 byte) and peer-id (3 bytes) */
333 if (v2)
334 {
335 uint32_t peer_id = ((uint32_t)ptr[1] << 16) | ((uint32_t)ptr[2] << 8) | ((uint32_t)ptr[3]);
336 peer_id_disabled = (peer_id == MAX_PEER_ID);
337
338 if (!peer_id_disabled && (peer_id < m->max_clients) && (m->instances[peer_id]))
339 {
340 /* Floating on TCP will never be possible, so ensure we only process
341 * UDP clients */
342 if (m->instances[peer_id]->context.c2.link_sockets[0]->info.proto
343 == sock->info.proto)
344 {
345 mi = m->instances[peer_id];
346 *floated = !link_socket_actual_match(&mi->context.c2.from, &m->top.c2.from);
347
348 if (*floated)
349 {
350 /* reset prefix, since here we are not sure peer is the one it claims to be
351 */
353 struct gc_arena gc = gc_new();
354 msg(D_MULTI_MEDIUM, "Float requested for peer %" PRIu32 " to %s", peer_id,
355 mroute_addr_print(real, &gc));
356 gc_free(&gc);
357 }
358 return mi;
359 }
360 }
361 }
362 if (!v2 || peer_id_disabled)
363 {
364 return multi_get_instance_udp_real(m, real);
365 }
366 return NULL;
367}
368
369struct multi_instance *
370multi_get_create_instance_udp(struct multi_context *m, bool *floated, struct link_socket *sock)
371{
372 /* If the buffer is empty, the packet has no op code and can be neither
373 * a (valid) data nor control packet */
374 if (m->top.c2.buf.len <= 0)
375 {
376 return NULL;
377 }
378
379 uint8_t *ptr = BPTR(&m->top.c2.buf);
380 uint8_t op = ptr[0] >> P_OPCODE_SHIFT;
381
382 struct mroute_addr real = { 0 };
383 real.proto = sock->info.proto;
384
385 if (!mroute_extract_openvpn_sockaddr(&real, &m->top.c2.from.dest, true))
386 {
387 return NULL;
388 }
389
390 struct multi_instance *mi = NULL;
391 if (op == P_DATA_V1 || op == P_DATA_V2)
392 {
393 mi = multi_get_instance_udp_data(m, floated, &real, sock);
394 }
395 else
396 {
397 mi = multi_get_instance_udp_control(m, sock);
398
399 /* we have no existing multi instance for this connection, control
400 * packets can create a session. Data packets cannot */
401 if (!mi)
402 {
403 mi = handle_connection_attempt(m, sock, &real);
404 }
405 }
406
407#ifdef ENABLE_DEBUG
409 {
410 struct gc_arena gc = gc_new();
411 const char *status = mi ? "[ok]" : "[failed]";
412
413 dmsg(D_MULTI_DEBUG, "GET INST BY REAL/SID: %s %s", mroute_addr_print(&real, &gc), status);
414 gc_free(&gc);
415 }
416#endif
417
418 ASSERT(!(mi && mi->halt));
419 return mi;
420}
421
422/*
423 * Send a packet to UDP socket.
424 */
425static inline void
426multi_process_outgoing_link(struct multi_context *m, const unsigned int mpp_flags)
427{
429 if (mi)
430 {
431 multi_process_outgoing_link_dowork(m, mi, mpp_flags);
432 }
433}
434
435/*
436 * Process a UDP socket event.
437 */
438void
439multi_process_io_udp(struct multi_context *m, struct link_socket *sock, unsigned int rwflags)
440{
441 const unsigned int mpp_flags = (MPP_PRE_SELECT | MPP_CLOSE_ON_SIGNAL);
442
443 /* UDP port ready to accept write */
444 if (rwflags & SOCKET_WRITE)
445 {
446 multi_process_outgoing_link(m, mpp_flags);
447 }
448 /* Incoming data on UDP port */
449 else if (rwflags & SOCKET_READ)
450 {
451 read_incoming_link(&m->top, sock);
452 if (!IS_SIG(&m->top))
453 {
454 multi_process_incoming_link(m, NULL, mpp_flags, sock);
455 }
456 }
457}
static bool buf_copy(struct buffer *dest, const struct buffer *src)
Copy the content of one buffer to the end of another.
Definition buffer.h:1301
#define BPTR(buf)
Return a pointer to the start of the buffer content.
Definition buffer.h:139
static bool buf_advance(struct buffer *buf, ssize_t size)
Advance the content start of a buffer, consuming bytes from the front.
Definition buffer.h:1124
static void gc_free(struct gc_arena *a)
Free all allocations in a garbage collection arena.
Definition buffer.h:1909
#define buf_init(buf, offset)
Definition buffer.h:356
static struct gc_arena gc_new(void)
Allocate and return a new, empty garbage collection arena.
Definition buffer.h:1893
#define CO_FORCE_TLSCRYPTV2_COOKIE
Bit-flag indicating that we do not allow clients that do not support resending the wrapped client key...
Definition crypto.h:367
#define D_MULTI_ERRORS
Definition errlevel.h:64
#define D_MULTI_MEDIUM
Definition errlevel.h:101
#define D_MULTI_DEBUG
Definition errlevel.h:126
#define SOCKET_READ
Definition event.h:60
#define SOCKET_WRITE
Definition event.h:61
Interface functions to the internal and external multiplexers.
#define TM_INITIAL
As yet un-trusted tls_session \ being negotiated.
Definition ssl_common.h:545
enum first_packet_verdict tls_pre_decrypt_lite(const struct tls_auth_standalone *tas, struct tls_pre_decrypt_state *state, const struct link_socket_actual *from, const struct buffer *buf)
Inspect an incoming packet for which no VPN tunnel is active, and determine whether a new VPN tunnel ...
Definition ssl_pkt.c:295
bool multi_process_incoming_link(struct multi_context *m, struct multi_instance *instance, const unsigned int mpp_flags, struct link_socket *sock)
Demultiplex and process a packet received over the external network interface.
Definition multi.c:3497
void process_outgoing_link(struct context *c, struct link_socket *sock)
Write a packet to the external network interface.
Definition forward.c:1746
void read_incoming_link(struct context *c, struct link_socket *sock)
Read a packet from the external network interface.
Definition forward.c:926
struct multi_instance * multi_get_create_instance_udp(struct multi_context *m, bool *floated, struct link_socket *sock)
Get, and if necessary create, the multi_instance associated with a packet's source address.
Definition mudp.c:370
static SERVICE_STATUS status
Definition interactive.c:52
struct hash_element * hash_lookup_fast(struct hash *hash, struct hash_bucket *bucket, const void *key, uint64_t hv)
Definition list.c:81
static void hash_add_fast(struct hash *hash, struct hash_bucket *bucket, const void *key, uint64_t hv, void *value)
Definition list.h:149
static uint64_t hash_value(const struct hash *hash, const void *key)
Definition list.h:107
bool mroute_extract_openvpn_sockaddr(struct mroute_addr *addr, const struct openvpn_sockaddr *osaddr, bool use_port)
Definition mroute.c:255
const char * mroute_addr_print(const struct mroute_addr *ma, struct gc_arena *gc)
Definition mroute.c:372
struct multi_instance * multi_get_instance_udp_data(struct multi_context *m, bool *floated, struct mroute_addr *real, struct link_socket *sock)
Get a client instance based on real address.
Definition mudp.c:323
static void send_standalone_reply(struct multi_context *m, struct buffer *buf, const char *prefix, const char *detail, struct link_socket *sock)
Send an already-built standalone control packet back to the peer that just contacted us (c2....
Definition mudp.c:56
static struct multi_instance * handle_connection_attempt(struct multi_context *m, struct link_socket *sock, struct mroute_addr *real)
Handles a packet if no existing session exists for this incoming packet.
Definition mudp.c:219
static bool do_pre_decrypt_check(struct multi_context *m, struct tls_pre_decrypt_state *state, struct mroute_addr addr, struct link_socket *sock)
Definition mudp.c:93
static void send_hmac_reset_packet(struct multi_context *m, struct tls_pre_decrypt_state *state, struct tls_auth_standalone *tas, struct session_id *sid, bool request_resend_wkc, struct link_socket *sock)
Definition mudp.c:76
static struct multi_instance * multi_get_instance_udp_real(struct multi_context *m, struct mroute_addr *real)
Looks up an multi instance by its real address (IP and port)
Definition mudp.c:289
static void multi_process_outgoing_link(struct multi_context *m, const unsigned int mpp_flags)
Definition mudp.c:426
void multi_process_io_udp(struct multi_context *m, struct link_socket *sock, unsigned int rwflags)
Definition mudp.c:439
struct multi_instance * multi_get_instance_udp_control(struct multi_context *m, struct link_socket *sock)
Definition mudp.c:304
struct multi_instance * multi_create_instance(struct multi_context *m, const struct mroute_addr *real, struct link_socket *sock)
Definition multi.c:702
void ungenerate_prefix(struct multi_instance *mi)
Definition multi.c:465
void multi_assign_peer_id(struct multi_context *m, struct multi_instance *mi)
Assigns a peer-id to a a client and adds the instance to the the instances array of the multi_context...
Definition multi.c:4135
Header file for server-mode related structures and functions.
#define MPP_CLOSE_ON_SIGNAL
Definition multi.h:270
static struct multi_instance * multi_process_outgoing_link_pre(struct multi_context *m)
Definition multi.h:409
#define MPP_PRE_SELECT
Definition multi.h:269
static bool multi_process_outgoing_link_dowork(struct multi_context *m, struct multi_instance *mi, const unsigned int mpp_flags)
Definition multi.h:657
static bool check_debug_level(msglvl_t level)
Definition error.h:251
static void msg_set_prefix(const char *prefix)
Definition error.h:332
#define dmsg(flags,...)
Definition error.h:172
#define msg(flags,...)
Definition error.h:152
#define ASSERT(x)
Definition error.h:219
#define MAX_PEER_ID
Definition openvpn.h:550
bool frequency_limit_event_allowed(struct frequency_limit *f)
Definition otime.c:158
bool packet_id_read(struct packet_id_net *pin, struct buffer *buf, bool long_form)
Definition packet_id.c:319
static void reset_packet_id_send(struct packet_id_send *p)
Reset the current send packet id to its initial state.
Definition packet_id.h:312
void reflect_filter_rate_limit_decrease(struct initial_packet_rate_limit *irl)
decreases the counter of initial packets seen, so connections that successfully completed the three-w...
bool reflect_filter_rate_limit_check(struct initial_packet_rate_limit *irl)
checks if the connection is still allowed to connect under the rate limit.
static bool session_id_defined(const struct session_id *sid1)
Definition session_id.h:53
#define SID_SIZE
Definition session_id.h:44
#define IS_SIG(c)
Definition sig.h:47
const char * print_link_socket_actual(const struct link_socket_actual *act, struct gc_arena *gc)
static bool link_socket_actual_match(const struct link_socket_actual *a1, const struct link_socket_actual *a2)
bool session_skip_to_pre_start(struct tls_session *session, struct tls_pre_decrypt_state *state, struct link_socket_actual *from)
Definition ssl.c:2551
void free_tls_pre_decrypt_state(struct tls_pre_decrypt_state *state)
Definition ssl_pkt.c:273
struct buffer tls_reset_standalone(struct tls_wrap_ctx *ctx, struct tls_auth_standalone *tas, struct session_id *own_sid, struct session_id *remote_sid, uint8_t header, bool request_resend_wkc)
This function creates a reset packet using the information from the tls pre decrypt state.
Definition ssl_pkt.c:405
struct session_id calculate_session_id_hmac(struct session_id client_sid, const struct openvpn_sockaddr *from, const uint8_t *key, int handwindow, int offset)
Calculates the HMAC based server session id based on a client session id and socket addr.
Definition ssl_pkt.c:447
bool check_session_hmac_and_pkt_id(struct tls_pre_decrypt_state *state, const struct openvpn_sockaddr *from, uint8_t *key, int handwindow, bool pkt_is_ack)
Checks if a control packet has a correct HMAC server session id.
Definition ssl_pkt.c:490
SSL control channel wrap/unwrap and decode functions.
#define P_DATA_V1
Definition ssl_pkt.h:47
#define P_DATA_V2
Definition ssl_pkt.h:48
#define P_OPCODE_SHIFT
Definition ssl_pkt.h:39
static const char * packet_opcode_name(int op)
Definition ssl_pkt.h:231
#define EARLY_NEG_MASK
Definition ssl_pkt.h:304
#define P_CONTROL_HARD_RESET_SERVER_V2
Definition ssl_pkt.h:52
first_packet_verdict
Definition ssl_pkt.h:85
@ VERDICT_VALID_ACK_V1
This packet is a valid ACK control packet from the peer, i.e.
Definition ssl_pkt.h:94
@ VERDICT_VALID_WKC_V1
The packet is a valid control packet with appended wrapped client key.
Definition ssl_pkt.h:96
@ VERDICT_VALID_RESET_V2
This packet is a valid reset packet from the peer (all but tls-crypt-v2)
Definition ssl_pkt.h:87
@ VERDICT_VALID_RESET_V3
This is a valid v3 reset (tls-crypt-v2)
Definition ssl_pkt.h:89
@ VERDICT_VALID_CONTROL_V1
This packet is a valid control packet from the peer.
Definition ssl_pkt.h:91
#define EARLY_NEG_START
Definition ssl_pkt.h:305
Wrapper structure for dynamically allocated memory.
Definition buffer.h:71
int len
Length in bytes of the actual content within the allocated memory.
Definition buffer.h:76
int offset
Offset in bytes of the actual content within the allocated memory.
Definition buffer.h:74
struct tls_auth_standalone * tls_auth_standalone
TLS state structure required for the initial authentication of a client's connection attempt.
Definition openvpn.h:327
struct tls_multi * tls_multi
TLS state structure for this VPN tunnel.
Definition openvpn.h:324
struct link_socket_actual from
Definition openvpn.h:246
struct buffer to_link
Definition openvpn.h:377
struct link_socket ** link_sockets
Definition openvpn.h:238
uint8_t session_id_key[SIPHASH_KEY_SIZE]
the siphash secret we use to generate and verify our syn cookie like session ids from the server.
Definition openvpn.h:339
struct link_socket_actual * to_link_addr
Definition openvpn.h:245
struct buffer buf
Definition openvpn.h:375
struct context_buffers * buffers
Definition openvpn.h:367
struct buffer aux_buf
Definition openvpn.h:98
Contains all state information for one tunnel.
Definition openvpn.h:471
struct context_2 c2
Level 2 context.
Definition openvpn.h:514
struct options options
Options loaded from command line or configuration file.
Definition openvpn.h:472
unsigned int flags
Bit-flags determining behavior of security operation functions.
Definition crypto.h:386
struct packet_id packet_id
Current packet ID state for both sending and receiving directions.
Definition crypto.h:333
int signal_received
Definition multi.h:62
Garbage collection arena used to keep track of dynamically allocated memory.
Definition buffer.h:127
void * value
Definition list.h:41
Definition list.h:56
uint8_t proto
Definition mroute.h:84
uint8_t len
Definition mroute.h:83
Main OpenVPN server state structure.
Definition multi.h:162
struct initial_packet_rate_limit * initial_rate_limiter
Definition multi.h:180
struct deferred_signal_schedule_entry deferred_shutdown_signal
Definition multi.h:214
struct hash * hash
VPN tunnel instances indexed by real address of the remote peer.
Definition multi.h:169
struct frequency_limit * new_connection_limiter
Definition multi.h:179
struct context top
Storage structure for process-wide configuration.
Definition multi.h:201
struct multi_instance ** instances
Array of multi_instances with the size of max_clients.
Definition multi.h:163
Server-mode state structure for one single VPN tunnel.
Definition multi.h:102
struct mroute_addr real
External network address of the remote peer.
Definition multi.h:121
bool did_real_hash
Definition multi.h:134
struct context context
The context structure storing state for this VPN tunnel.
Definition multi.h:142
int handshake_window
Definition options.h:651
Data structure for describing the packet id that is received/send to the network.
Definition packet_id.h:191
struct packet_id_send send
Definition packet_id.h:200
struct packet_id_rec rec
Definition packet_id.h:201
struct tls_wrap_ctx tls_wrap
Definition ssl_pkt.h:79
struct tls_session session[TM_SIZE]
Array of tls_session objects representing control channel sessions with the remote peer.
Definition ssl_common.h:713
int n_sessions
Number of sessions negotiated thus far.
Definition ssl_common.h:630
struct that stores the temporary data for the tls lite decrypt functions
Definition ssl_pkt.h:106
struct session_id peer_session_id
Definition ssl_pkt.h:109
struct session_id server_session_id
Definition ssl_pkt.h:110
struct tls_wrap_ctx tls_wrap_tmp
Definition ssl_pkt.h:107
Security parameter state of a single session within a VPN tunnel.
Definition ssl_common.h:489
struct crypto_options opt
Crypto state.
Definition ssl_common.h:283
struct gc_arena gc
Definition test_ssl.c:122