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
109
111static enum pre_decrypt_verdict
113 struct mroute_addr addr, struct link_socket *sock)
114{
116
117 enum first_packet_verdict verdict;
118
120
121 verdict = tls_pre_decrypt_lite(tas, state, &m->top.c2.from, &m->top.c2.buf);
122
123 uint8_t *hmac_key = m->top.c2.session_id_key;
124 const struct openvpn_sockaddr *from = &m->top.c2.from.dest;
125 int handwindow = m->top.options.handshake_window;
126
127 if (verdict == VERDICT_VALID_RESET_V3 || verdict == VERDICT_VALID_RESET_V2)
128 {
129 /* Check if we are still below our limit for sending out
130 * responses */
132 {
134 }
135 }
136
137 if (verdict == VERDICT_VALID_RESET_V3)
138 {
139 /* Extract the packet id to check if it has the special format that
140 * indicates early negotiation support */
141 struct packet_id_net pin;
142 struct buffer tmp = m->top.c2.buf;
143 ASSERT(buf_advance(&tmp, 1 + SID_SIZE));
144 ASSERT(packet_id_read(&pin, &tmp, true));
145
146 /* The most significant byte is 0x0f if early negotiation is supported */
147 bool early_neg_support = ((pin.id & EARLY_NEG_MASK) & EARLY_NEG_START) == EARLY_NEG_START;
148
149 /* All clients that support early negotiation and tls-crypt are assumed
150 * to also support resending the WKc in the 2nd packet */
151 if (early_neg_support)
152 {
153 /* Calculate the session ID HMAC for our reply and create reset packet */
154 struct session_id sid =
155 calculate_session_id_hmac(state->peer_session_id, from, hmac_key, handwindow, 0);
156 send_hmac_reset_packet(m, state, tas, &sid, true, sock);
157
159 }
160 else
161 {
162 /* For tls-crypt-v2 we need to keep the state of the first packet
163 * to store the unwrapped key if the client doesn't support resending
164 * the wrapped key. Unless the user specifically disallowed
165 * compatibility with such clients to avoid state exhaustion */
167 {
168 struct gc_arena gc = gc_new();
169 const char *peer = print_link_socket_actual(&m->top.c2.from, &gc);
171 "tls-crypt-v2 force-cookie is enabled, "
172 "ignoring connection attempt from old client (%s)",
173 peer);
174 gc_free(&gc);
176 }
177 else
178 {
180 }
181 }
182 }
183 else if (verdict == VERDICT_VALID_RESET_V2)
184 {
185 /* Calculate the session ID HMAC for our reply and create reset packet */
186 struct session_id sid =
187 calculate_session_id_hmac(state->peer_session_id, from, hmac_key, handwindow, 0);
188
189 send_hmac_reset_packet(m, state, tas, &sid, false, sock);
190
191 /* We have a reply do not create a new session */
193 }
194 else if (verdict == VERDICT_VALID_CONTROL_V1 || verdict == VERDICT_VALID_ACK_V1
195 || verdict == VERDICT_VALID_WKC_V1)
196 {
197 /* ACK_V1 contains the peer id (our id) while CONTROL_V1 can but does not
198 * need to contain the peer id */
199 struct gc_arena gc = gc_new();
200
201 bool pkt_is_ack = (verdict == VERDICT_VALID_ACK_V1);
202 bool ret = check_session_hmac_and_pkt_id(state, from, hmac_key, handwindow, pkt_is_ack);
204
205 const char *peer = print_link_socket_actual(&m->top.c2.from, &gc);
206 uint8_t pkt_firstbyte = *BPTR(&m->top.c2.buf);
207 int op = pkt_firstbyte >> P_OPCODE_SHIFT;
208
209 if (!ret)
210 {
211 msg(D_MULTI_MEDIUM, "Packet (%s) with invalid or missing SID from"
212 " %s or wrong packet id",
213 packet_opcode_name(op), peer);
214 }
215 else
216 {
218 "Valid packet (%s) with HMAC challenge from peer (%s), "
219 "accepting new connection.",
220 packet_opcode_name(op), peer);
222 }
223 gc_free(&gc);
224
225 return action;
226 }
227
228 /* VERDICT_INVALID */
230}
231
239static struct multi_instance *
241 struct link_socket *sock,
242 struct mroute_addr *real)
243{
244 struct gc_arena gc = gc_new();
245
247 {
249 "MULTI: Connection attempt from %s ignored while server is "
250 "shutting down",
251 mroute_addr_print(real, &gc));
252 gc_free(&gc);
253 return NULL;
254 }
255
256 struct hash *hash = m->hash;
257 struct tls_pre_decrypt_state state = { 0 };
258 struct multi_instance *mi = NULL;
259
260 enum pre_decrypt_verdict verdict = do_pre_decrypt_check(m, &state, *real, sock);
261
262 if (verdict != PRE_DECRYPT_NO_ACTION)
263 {
264 /* This is an unknown session but with valid tls-auth/tls-crypt
265 * (or no auth at all). If this is the initial packet of a
266 * session, we just send a reply with a HMAC session id and
267 * do not generate a session slot */
268
270 {
271 /* a successful three-way handshake only counts against
272 * connect-freq but not against connect-freq-initial */
274
275 mi = multi_create_instance(m, real, sock);
276 if (mi)
277 {
278 const uint64_t hv = hash_value(hash, real);
279 struct hash_bucket *bucket = hash_bucket(hash, hv);
280 hash_add_fast(hash, bucket, &mi->real, hv, mi);
281
282 mi->did_real_hash = true;
284
285 struct tls_session *session =
287
288 if (verdict == PRE_DECRYPT_CREATE_SESSION_SKIP)
289 {
290 /* This verdict is only possible if we have a peer session ID */
294 }
295 }
296 }
297 else
298 {
300 "MULTI: Connection from %s would exceed new connection frequency limit as controlled by --connect-freq",
301 mroute_addr_print(real, &gc));
302 }
303 }
305 gc_free(&gc);
306 return mi;
307}
308
315static struct multi_instance *
317{
318 struct hash *hash = m->hash;
319 const uint64_t hv = hash_value(hash, real);
320 struct hash_bucket *bucket = hash_bucket(hash, hv);
321 const struct hash_element *he = hash_lookup_fast(hash, bucket, real, hv);
322 if (he)
323 {
324 return he->value;
325 }
326 return NULL;
327}
328
329struct multi_instance *
331{
332 struct mroute_addr real = { 0 };
333 real.proto = sock->info.proto;
334
335 if (mroute_extract_openvpn_sockaddr(&real, &m->top.c2.from.dest, true) && m->top.c2.buf.len > 0)
336 {
337 return multi_get_instance_udp_real(m, &real);
338 }
339
340 return NULL;
341}
342
348struct multi_instance *
349multi_get_instance_udp_data(struct multi_context *m, bool *floated, struct mroute_addr *real, struct link_socket *sock)
350{
351 struct multi_instance *mi = NULL;
352
353 const uint8_t *ptr = BPTR(&m->top.c2.buf);
354 uint8_t op = ptr[0] >> P_OPCODE_SHIFT;
355 bool v2 = (op == P_DATA_V2) && (m->top.c2.buf.len >= (1 + 3));
356 bool peer_id_disabled = false;
357
358 /* make sure buffer has enough length to read opcode (1 byte) and peer-id (3 bytes) */
359 if (v2)
360 {
361 uint32_t peer_id = ((uint32_t)ptr[1] << 16) | ((uint32_t)ptr[2] << 8) | ((uint32_t)ptr[3]);
362 peer_id_disabled = (peer_id == MAX_PEER_ID);
363
364 if (!peer_id_disabled && (peer_id < m->max_clients) && (m->instances[peer_id]))
365 {
366 /* Floating on TCP will never be possible, so ensure we only process
367 * UDP clients */
368 if (m->instances[peer_id]->context.c2.link_sockets[0]->info.proto
369 == sock->info.proto)
370 {
371 mi = m->instances[peer_id];
372 *floated = !link_socket_actual_match(&mi->context.c2.from, &m->top.c2.from);
373
374 if (*floated)
375 {
376 /* reset prefix, since here we are not sure peer is the one it claims to be
377 */
379 struct gc_arena gc = gc_new();
380 msg(D_MULTI_MEDIUM, "Float requested for peer %" PRIu32 " to %s", peer_id,
381 mroute_addr_print(real, &gc));
382 gc_free(&gc);
383 }
384 return mi;
385 }
386 }
387 }
388 if (!v2 || peer_id_disabled)
389 {
390 return multi_get_instance_udp_real(m, real);
391 }
392 return NULL;
393}
394
395struct multi_instance *
396multi_get_create_instance_udp(struct multi_context *m, bool *floated, struct link_socket *sock)
397{
398 /* If the buffer is empty, the packet has no op code and can be neither
399 * a (valid) data nor control packet */
400 if (m->top.c2.buf.len <= 0)
401 {
402 return NULL;
403 }
404
405 const uint8_t *ptr = BPTR(&m->top.c2.buf);
406 uint8_t op = ptr[0] >> P_OPCODE_SHIFT;
407
408 struct mroute_addr real = { 0 };
409 real.proto = sock->info.proto;
410
411 if (!mroute_extract_openvpn_sockaddr(&real, &m->top.c2.from.dest, true))
412 {
413 return NULL;
414 }
415
416 struct multi_instance *mi = NULL;
417 if (op == P_DATA_V1 || op == P_DATA_V2)
418 {
419 mi = multi_get_instance_udp_data(m, floated, &real, sock);
420 }
421 else
422 {
423 mi = multi_get_instance_udp_control(m, sock);
424
425 /* we have no existing multi instance for this connection, control
426 * packets can create a session. Data packets cannot */
427 if (!mi)
428 {
429 mi = handle_connection_attempt(m, sock, &real);
430 }
431 }
432
433#ifndef ENABLE_SMALL
435 {
436 struct gc_arena gc = gc_new();
437 const char *status = mi ? "[ok]" : "[failed]";
438
439 dmsg(D_MULTI_DEBUG, "GET INST BY REAL/SID: %s %s", mroute_addr_print(&real, &gc), status);
440 gc_free(&gc);
441 }
442#endif
443
444 ASSERT(!(mi && mi->halt));
445 return mi;
446}
447
448/*
449 * Send a packet to UDP socket.
450 */
451static inline void
452multi_process_outgoing_link(struct multi_context *m, const unsigned int mpp_flags)
453{
455 if (mi)
456 {
457 multi_process_outgoing_link_dowork(m, mi, mpp_flags);
458 }
459}
460
461/*
462 * Process a UDP socket event.
463 */
464void
465multi_process_io_udp(struct multi_context *m, struct link_socket *sock, unsigned int rwflags)
466{
467 const unsigned int mpp_flags = (MPP_PRE_SELECT | MPP_CLOSE_ON_SIGNAL);
468
469 /* UDP port ready to accept write */
470 if (rwflags & SOCKET_WRITE)
471 {
472 multi_process_outgoing_link(m, mpp_flags);
473 }
474 /* Incoming data on UDP port */
475 else if (rwflags & SOCKET_READ)
476 {
477 read_incoming_link(&m->top, sock);
478 if (!IS_SIG(&m->top))
479 {
480 multi_process_incoming_link(m, NULL, mpp_flags, sock);
481 }
482 }
483}
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:1365
#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:1188
static void gc_free(struct gc_arena *a)
Free all allocations in a garbage collection arena.
Definition buffer.h:1976
#define buf_init(buf, offset)
Definition buffer.h:364
static struct gc_arena gc_new(void)
Allocate and return a new, empty garbage collection arena.
Definition buffer.h:1960
#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:296
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:3502
void process_outgoing_link(struct context *c, struct link_socket *sock)
Write a packet to the external network interface.
Definition forward.c:1769
void read_incoming_link(struct context *c, struct link_socket *sock)
Read a packet from the external network interface.
Definition forward.c:949
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:396
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 struct hash_bucket * hash_bucket(struct hash *hash, uint64_t hv)
Definition list.h:125
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
static enum pre_decrypt_verdict do_pre_decrypt_check(struct multi_context *m, struct tls_pre_decrypt_state *state, struct mroute_addr addr, struct link_socket *sock)
Returns a verdict if this packet should create a new session.
Definition mudp.c:112
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:349
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:240
pre_decrypt_verdict
Verdict if this packet should create a new session.
Definition mudp.c:96
@ PRE_DECRYPT_CREATE_SESSION_SKIP
Creates a new session.
Definition mudp.c:107
@ PRE_DECRYPT_CREATE_SESSION
This packet creates a new session on the first packet on the session.
Definition mudp.c:103
@ PRE_DECRYPT_NO_ACTION
This packet should not create a new session.
Definition mudp.c:98
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:316
static void multi_process_outgoing_link(struct multi_context *m, const unsigned int mpp_flags)
Definition mudp.c:452
void multi_process_io_udp(struct multi_context *m, struct link_socket *sock, unsigned int rwflags)
Definition mudp.c:465
struct multi_instance * multi_get_instance_udp_control(struct multi_context *m, struct link_socket *sock)
Definition mudp.c:330
struct multi_instance * multi_create_instance(struct multi_context *m, const struct mroute_addr *real, struct link_socket *sock)
Definition multi.c:705
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:4150
Header file for server-mode related structures and functions.
#define MPP_CLOSE_ON_SIGNAL
Definition multi.h:271
static struct multi_instance * multi_process_outgoing_link_pre(struct multi_context *m)
Definition multi.h:408
#define MPP_PRE_SELECT
Definition multi.h:270
static bool multi_process_outgoing_link_dowork(struct multi_context *m, struct multi_instance *mi, const unsigned int mpp_flags)
Definition multi.h:656
static bool check_debug_level(msglvl_t level)
Definition error.h:253
static void msg_set_prefix(const char *prefix)
Definition error.h:334
#define dmsg(flags,...)
Definition error.h:164
#define msg(flags,...)
Definition error.h:152
#define ASSERT(x)
Definition error.h:221
#define MAX_PEER_ID
Definition openvpn.h:552
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:317
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:2602
void free_tls_pre_decrypt_state(struct tls_pre_decrypt_state *state)
Definition ssl_pkt.c:274
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:406
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:448
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:491
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:516
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
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
uint64_t id
Definition packet_id.h:194
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 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