OpenVPN
acc.h
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) 2025 OpenVPN Inc <sales@openvpn.net>
9 * Copyright (C) 2025 Arne Schwabe <arne@rfc2549.org>
10 *
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 */
25
26#ifndef ACC_H
27#define ACC_H
28
29#include "openvpn.h"
30
31#define ACC_MIN_MSG_LEN 64
32/* This is a conservative limit. The theoretical maximum
33 * is much closer to the TLS_CHANNEL_BUF_SIZE */
34#define ACC_MAX_MSG_LEN (TLS_CHANNEL_BUF_SIZE - 128)
35
44void
45receive_acc_message(struct context *c, const struct buffer *buffer);
46
47bool
49 struct tls_multi *tls_multi,
50 struct tls_session *session,
51 const char *protocol, bool fragment,
52 const char *msg, bool base64);
53
54
73char *
74parse_acc_parameters(const char *capabilities,
75 const char *delim,
76 int *max_acc_len,
77 bool server,
78 struct gc_arena *gc);
79
92void
94
104
110int
111parse_acc_message_flags(const char *flags, const char **err_reason, struct gc_arena *gc);
112
122struct buffer
123get_list_intersection(struct gc_arena *gc, const char *list1, const char *list2);
124
130void
132#endif
void receive_acc_message(struct context *c, const struct buffer *buffer)
This method parses an app custom control message and delivers it to the management interface.
Definition acc.c:152
char * parse_acc_parameters(const char *capabilities, const char *delim, int *max_acc_len, bool server, struct gc_arena *gc)
Parses an info message from the server that contains app custom control info information prior to the...
Definition acc.c:286
bool send_acc_message(struct context *c, struct tls_multi *tls_multi, struct tls_session *session, const char *protocol, bool fragment, const char *msg, bool base64)
Definition acc.c:239
void determine_common_acc_protocols(struct tls_multi *multi, struct tls_session *session)
Parses the IV_ACC of the peer and sets multi.acc_negotiated_protocols to the common protocols of serv...
Definition acc.c:381
acc_message_flag
Flags returned by the parse_acc_message_flags method.
Definition acc.h:99
@ ACC_MESSAGE_FLAGS_FRAGMENT
Definition acc.h:102
@ ACC_MESSAGE_FLAGS_BASE64
Definition acc.h:101
@ ACC_MESSAGE_FLAGS_ASCII
Definition acc.h:100
struct buffer get_list_intersection(struct gc_arena *gc, const char *list1, const char *list2)
Calculates the intersection of two list that are both separated by : Items in the result will have th...
Definition acc.c:350
int parse_acc_message_flags(const char *flags, const char **err_reason, struct gc_arena *gc)
Parses the flags field of an app control message If there is an error parsing the flags field the met...
Definition acc.c:91
void notify_client_acc_protocols(struct tls_multi *multi)
Notifies a client via management interface of the negotiated app custom protocols.
Definition acc.c:447
#define msg(flags,...)
Definition error.h:152
Wrapper structure for dynamically allocated memory.
Definition buffer.h:71
Contains all state information for one tunnel.
Definition openvpn.h:445
Structure for reassembling one incoming fragmented packet.
Definition fragment.h:65
Garbage collection arena used to keep track of dynamically allocated memory.
Definition buffer.h:127
Security parameter state for a single VPN tunnel.
Definition ssl_common.h:619
Security parameter state of a single session within a VPN tunnel.
Definition ssl_common.h:497
struct gc_arena gc
Definition test_ssl.c:138