diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 2 | ||||
-rw-r--r-- | include/Makefile.in | 36 | ||||
-rw-r--r-- | include/openvpn-msg.h | 10 | ||||
-rw-r--r-- | include/openvpn-plugin.h | 46 | ||||
-rw-r--r-- | include/openvpn-plugin.h.in | 44 |
5 files changed, 112 insertions, 26 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index a52c427..484e4e1 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,7 +5,7 @@ # packet encryption, packet authentication, and # packet compression. # -# Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net> +# Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net> # Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com> # diff --git a/include/Makefile.in b/include/Makefile.in index 7a9c512..28dff09 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -21,12 +21,22 @@ # packet encryption, packet authentication, and # packet compression. # -# Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net> +# Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net> # Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com> # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -90,8 +100,6 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/openvpn-plugin.h.in $(include_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_emptyarray.m4 \ $(top_srcdir)/m4/ax_socklen_t.m4 \ @@ -102,6 +110,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_emptyarray.m4 \ $(top_srcdir)/compat.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ + $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h openvpn-plugin.h CONFIG_CLEAN_FILES = @@ -174,6 +184,7 @@ am__define_uniq_tagged_files = \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/openvpn-plugin.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -222,6 +233,7 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZ4_CFLAGS = @LZ4_CFLAGS@ LZ4_LIBS = @LZ4_LIBS@ LZO_CFLAGS = @LZO_CFLAGS@ @@ -377,14 +389,13 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -486,7 +497,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -636,6 +650,8 @@ uninstall-am: uninstall-includeHEADERS mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-includeHEADERS +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/include/openvpn-msg.h b/include/openvpn-msg.h index 91e0ccc..66177a2 100644 --- a/include/openvpn-msg.h +++ b/include/openvpn-msg.h @@ -5,7 +5,7 @@ * packet encryption, packet authentication, and * packet compression. * - * Copyright (C) 2013-2017 Heiko Hund <heiko.hund@sophos.com> + * Copyright (C) 2013-2018 Heiko Hund <heiko.hund@sophos.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -37,7 +37,8 @@ typedef enum { msg_flush_neighbors, msg_add_block_dns, msg_del_block_dns, - msg_register_dns + msg_register_dns, + msg_enable_dhcp, } message_type_t; typedef struct { @@ -111,4 +112,9 @@ typedef struct { interface_t iface; } block_dns_message_t; +typedef struct { + message_header_t header; + interface_t iface; +} enable_dhcp_message_t; + #endif /* ifndef OPENVPN_MSG_H_ */ diff --git a/include/openvpn-plugin.h b/include/openvpn-plugin.h index 8a7ba13..de9aa9f 100644 --- a/include/openvpn-plugin.h +++ b/include/openvpn-plugin.h @@ -6,7 +6,7 @@ * packet encryption, packet authentication, and * packet compression. * - * Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net> + * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -55,7 +55,7 @@ extern "C" { */ #define OPENVPN_VERSION_MAJOR 2 #define OPENVPN_VERSION_MINOR 4 -#define OPENVPN_VERSION_PATCH ".4" +#define OPENVPN_VERSION_PATCH ".7" /* * Plug-in types. These types correspond to the set of script callbacks @@ -222,8 +222,11 @@ struct openvpn_plugin_string_list * OpenVPN to plug-ins. * * 4 Exported secure_memzero() as plugin_secure_memzero() + * + * 5 Exported openvpn_base64_encode() as plugin_base64_encode() + * Exported openvpn_base64_decode() as plugin_base64_decode() */ -#define OPENVPN_PLUGINv3_STRUCTVER 4 +#define OPENVPN_PLUGINv3_STRUCTVER 5 /** * Definitions needed for the plug-in callback functions. @@ -270,6 +273,33 @@ typedef void (*plugin_vlog_t)(openvpn_plugin_log_flags_t flags, */ typedef void (*plugin_secure_memzero_t)(void *data, size_t len); +/** + * Export of openvpn_base64_encode() to be used inside plug-ins + * + * @param data Pointer to data to BASE64 encode + * @param size Length of data, in bytes + * @param *str Pointer to the return buffer. This needed memory is + * allocated by openvpn_base64_encode() and needs to be free()d + * after use. + * + * @return int Returns the length of the buffer created, or -1 on error. + * + */ +typedef int (*plugin_base64_encode_t)(const void *data, int size, char **str); + +/** + * Export of openvpn_base64_decode() to be used inside plug-ins + * + * @param str Pointer to the BASE64 encoded data + * @param data Pointer to the buffer where save the decoded data + * @param size Size of the destination buffer + * + * @return int Returns the length of the decoded data, or -1 on error or + * if the destination buffer is too small. + * + */ +typedef int (*plugin_base64_decode_t)(const char *str, void *data, int size); + /** * Used by the openvpn_plugin_open_v3() function to pass callback @@ -292,6 +322,8 @@ struct openvpn_plugin_callbacks plugin_log_t plugin_log; plugin_vlog_t plugin_vlog; plugin_secure_memzero_t plugin_secure_memzero; + plugin_base64_encode_t plugin_base64_encode; + plugin_base64_decode_t plugin_base64_decode; }; /** @@ -356,7 +388,7 @@ struct openvpn_plugin_args_open_in * type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT) * | OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_DISCONNECT) * - * *handle : Pointer to a global plug-in context, created by the plug-in. This pointer + * handle : Pointer to a global plug-in context, created by the plug-in. This pointer * is passed on to the other plug-in calls. * * return_list : used to return data back to OpenVPN. @@ -365,7 +397,7 @@ struct openvpn_plugin_args_open_in struct openvpn_plugin_args_open_return { int type_mask; - openvpn_plugin_handle_t *handle; + openvpn_plugin_handle_t handle; struct openvpn_plugin_string_list **return_list; }; @@ -387,9 +419,9 @@ struct openvpn_plugin_args_open_return * these variables are not actually written to the "official" * environmental variable store of the process. * - * *handle : Pointer to a global plug-in context, created by the plug-in's openvpn_plugin_open_v3(). + * handle : Pointer to a global plug-in context, created by the plug-in's openvpn_plugin_open_v3(). * - * *per_client_context : the per-client context pointer which was returned by + * per_client_context : the per-client context pointer which was returned by * openvpn_plugin_client_constructor_v1, if defined. * * current_cert_depth : Certificate depth of the certificate being passed over (only if compiled with ENABLE_CRYPTO defined) diff --git a/include/openvpn-plugin.h.in b/include/openvpn-plugin.h.in index f29b3a0..a604f1c 100644 --- a/include/openvpn-plugin.h.in +++ b/include/openvpn-plugin.h.in @@ -5,7 +5,7 @@ * packet encryption, packet authentication, and * packet compression. * - * Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net> + * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -221,8 +221,11 @@ struct openvpn_plugin_string_list * OpenVPN to plug-ins. * * 4 Exported secure_memzero() as plugin_secure_memzero() + * + * 5 Exported openvpn_base64_encode() as plugin_base64_encode() + * Exported openvpn_base64_decode() as plugin_base64_decode() */ -#define OPENVPN_PLUGINv3_STRUCTVER 4 +#define OPENVPN_PLUGINv3_STRUCTVER 5 /** * Definitions needed for the plug-in callback functions. @@ -269,6 +272,33 @@ typedef void (*plugin_vlog_t)(openvpn_plugin_log_flags_t flags, */ typedef void (*plugin_secure_memzero_t)(void *data, size_t len); +/** + * Export of openvpn_base64_encode() to be used inside plug-ins + * + * @param data Pointer to data to BASE64 encode + * @param size Length of data, in bytes + * @param *str Pointer to the return buffer. This needed memory is + * allocated by openvpn_base64_encode() and needs to be free()d + * after use. + * + * @return int Returns the length of the buffer created, or -1 on error. + * + */ +typedef int (*plugin_base64_encode_t)(const void *data, int size, char **str); + +/** + * Export of openvpn_base64_decode() to be used inside plug-ins + * + * @param str Pointer to the BASE64 encoded data + * @param data Pointer to the buffer where save the decoded data + * @param size Size of the destination buffer + * + * @return int Returns the length of the decoded data, or -1 on error or + * if the destination buffer is too small. + * + */ +typedef int (*plugin_base64_decode_t)(const char *str, void *data, int size); + /** * Used by the openvpn_plugin_open_v3() function to pass callback @@ -291,6 +321,8 @@ struct openvpn_plugin_callbacks plugin_log_t plugin_log; plugin_vlog_t plugin_vlog; plugin_secure_memzero_t plugin_secure_memzero; + plugin_base64_encode_t plugin_base64_encode; + plugin_base64_decode_t plugin_base64_decode; }; /** @@ -355,7 +387,7 @@ struct openvpn_plugin_args_open_in * type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT) * | OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_DISCONNECT) * - * *handle : Pointer to a global plug-in context, created by the plug-in. This pointer + * handle : Pointer to a global plug-in context, created by the plug-in. This pointer * is passed on to the other plug-in calls. * * return_list : used to return data back to OpenVPN. @@ -364,7 +396,7 @@ struct openvpn_plugin_args_open_in struct openvpn_plugin_args_open_return { int type_mask; - openvpn_plugin_handle_t *handle; + openvpn_plugin_handle_t handle; struct openvpn_plugin_string_list **return_list; }; @@ -386,9 +418,9 @@ struct openvpn_plugin_args_open_return * these variables are not actually written to the "official" * environmental variable store of the process. * - * *handle : Pointer to a global plug-in context, created by the plug-in's openvpn_plugin_open_v3(). + * handle : Pointer to a global plug-in context, created by the plug-in's openvpn_plugin_open_v3(). * - * *per_client_context : the per-client context pointer which was returned by + * per_client_context : the per-client context pointer which was returned by * openvpn_plugin_client_constructor_v1, if defined. * * current_cert_depth : Certificate depth of the certificate being passed over (only if compiled with ENABLE_CRYPTO defined) |