61 if (
o->ce.occ_mtu != 0)
88 o->ifconfig_remote_netmask,
o->ifconfig_ipv6_local,
o->ifconfig_ipv6_netbits,
119#ifdef ENABLE_FRAGMENT
126#define TLS_CLIENT (o->tls_client)
127#define TLS_SERVER (o->tls_server)
287 msg(msglevel,
"WARNING: '%s' is used inconsistently, %s='%s', %s='%s'",
296 msg(msglevel,
"WARNING: '%s' is present in %s config but missing in %s config, %s='%s'",
352 actual[actual_n - 1] = 0;
353 if (strncmp(actual, expected, 2))
355 msg(
D_SHOW_OCC,
"NOTE: Options consistency check may be skewed by version differences");
360 ret = !strcmp(actual, expected);
393#if defined(__GNUC__) || defined(__clang__)
394#pragma GCC diagnostic push
395#pragma GCC diagnostic ignored "-Wsign-compare"
412 const char *end =
strchr(
p,
',');
427#if defined(__GNUC__) || defined(__clang__)
428#pragma GCC diagnostic pop
bool buf_printf(struct buffer *buf, const char *format,...)
printf-style append to a buffer with overflow check.
void * gc_malloc(size_t size, bool clear, struct gc_arena *a)
Allocate memory and, optionally, zero it.
struct buffer alloc_buf_gc(size_t size, struct gc_arena *gc)
Allocate a buffer of the given size under garbage collection.
struct buffer alloc_buf(size_t size)
Allocate a buffer of the given size.
bool buf_parse(struct buffer *buf, const int delim, char *line, const int size)
Extract the next token from a buffer, delimited by a given character.
char * string_alloc(const char *str, struct gc_arena *gc)
Duplicate a string, allocating memory under garbage collection.
struct buffer string_alloc_buf(const char *str, struct gc_arena *gc)
Allocate a buffer containing a copy of the given string.
Buffer management functions and garbage collection.
#define BSTR(buf)
Return the buffer content pointer cast to char *.
#define BPTR(buf)
Return a pointer to the start of the buffer content.
static void strncpynt(char *dest, const char *src, size_t maxlen)
Like strncpy() but always null-terminates the destination.
static void gc_free(struct gc_arena *a)
Free all allocations in a garbage collection arena.
static bool strprefix(const char *str, const char *prefix)
Return true iff str starts with prefix.
static struct gc_arena gc_new(void)
Allocate and return a new, empty garbage collection arena.
void init_key_type(struct key_type *kt, const char *ciphername, const char *authname, bool tls_mode, bool warn)
Initialize a key_type structure with.
const char * keydirection2ascii(int kd, bool remote, bool humanreadable)
Data Channel Cryptography Module.
static bool cipher_defined(const char *ciphername)
Checks if the cipher is defined and is not the null (none) cipher.
const char * md_kt_name(const char *mdname)
Retrieve a string describing the digest digest (e.g.
const char * cipher_kt_name(const char *ciphername)
Retrieve a normalised string describing the cipher (e.g.
unsigned int cipher_kt_key_size(const char *ciphername)
Returns the size of keys used by the cipher, in bytes.
const char * safe_print(const char *str, struct gc_arena *gc)
size_t calc_options_string_link_mtu(const struct options *o, const struct frame *frame)
Calculate the link-mtu to advertise to our peer.
#define MODE_POINT_TO_POINT
#define PULL_DEFINED(opt)
bool options_cmp_equal(char *actual, const char *expected)
static const char * options_warning_extract_parm1(const char *option_string, struct gc_arena *gc_ret)
Compare option strings for equality.
bool options_cmp_equal_safe(char *actual, const char *expected, size_t actual_n)
void options_warning_safe(char *actual, const char *expected, size_t actual_n)
static void options_warning_safe_scan1(const msglvl_t msglevel, const int delim, const bool report_inconsistent, const struct buffer *b1_src, const struct buffer *b2_src, const char *b1_name, const char *b2_name)
static void options_warning_safe_ml(const msglvl_t msglevel, char *actual, const char *expected, size_t actual_n)
char * options_string_extract_option(const char *options_string, const char *opt_name, struct gc_arena *gc)
Given an OpenVPN options string, extract the value of an option.
static void options_warning_safe_scan2(const msglvl_t msglevel, const int delim, const bool report_inconsistent, const char *p1, const struct buffer *b2_src, const char *b1_name, const char *b2_name)
void options_warning(char *actual, const char *expected)
const char * options_string_version(const char *s, struct gc_arena *gc)
char * options_string(const struct options *o, const struct frame *frame, struct tuntap *tt, openvpn_net_ctx_t *ctx, bool remote, struct gc_arena *gc)
Build an options string to represent data channel encryption options.
const char * proto_remote(int proto, bool remote)
Control Channel SSL/Data channel negotiation module.
bool tls_item_in_cipher_list(const char *item, const char *list)
Return true iff item is present in the colon-separated zero-terminated cipher list.
Control Channel SSL/Data dynamic negotiation Module This file is split from ssl.h to be able to unit ...
Wrapper structure for dynamically allocated memory.
int len
Length in bytes of the actual content within the allocated memory.
const char * tls_auth_file
Packet geometry parameters.
int tun_mtu
the (user) configured tun-mtu.
Garbage collection arena used to keep track of dynamically allocated memory.
const char * cipher
const name of the cipher
const char * digest
Message digest static parameters.
struct connection_entry ce
const char * shared_secret_file
struct tuntap * init_tun(const char *dev, const char *dev_type, int topology, const char *ifconfig_local_parm, const char *ifconfig_remote_netmask_parm, const char *ifconfig_ipv6_local_parm, int ifconfig_ipv6_netbits_parm, const char *ifconfig_ipv6_remote_parm, struct addrinfo *local_public, struct addrinfo *remote_public, const bool strict_warn, struct env_set *es, openvpn_net_ctx_t *ctx, struct tuntap *tt)
const char * dev_type_string(const char *dev, const char *dev_type)
const char * ifconfig_options_string(const struct tuntap *tt, bool remote, bool disable, struct gc_arena *gc)