From 20c8675ba46bda97330a4117c459a59a9f1c465e Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Iniesta Date: Mon, 21 Nov 2016 09:37:33 +0100 Subject: New upstream version 2.4~beta1 --- include/openvpn-plugin.h | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'include/openvpn-plugin.h') diff --git a/include/openvpn-plugin.h b/include/openvpn-plugin.h index 5f2d407..9df3fb4 100644 --- a/include/openvpn-plugin.h +++ b/include/openvpn-plugin.h @@ -1,3 +1,4 @@ +/* include/openvpn-plugin.h. Generated from openvpn-plugin.h.in by configure. */ /* * OpenVPN -- An application to securely tunnel IP networks * over a single TCP/UDP port, with support for SSL/TLS-based @@ -27,12 +28,12 @@ #define OPENVPN_PLUGIN_VERSION 3 -#ifdef ENABLE_SSL -#ifdef ENABLE_CRYPTO_POLARSSL -#include +#ifdef ENABLE_CRYPTO +#ifdef ENABLE_CRYPTO_MBEDTLS +#include #ifndef __OPENVPN_X509_CERT_T_DECLARED #define __OPENVPN_X509_CERT_T_DECLARED -typedef x509_crt openvpn_x509_cert_t; +typedef mbedtls_x509_crt openvpn_x509_cert_t; #endif #else #include @@ -49,6 +50,13 @@ typedef X509 openvpn_x509_cert_t; extern "C" { #endif +/* Provide some basic version information to plug-ins at OpenVPN compile time + * This is will not be the complete version + */ +#define OPENVPN_VERSION_MAJOR 2 +#define OPENVPN_VERSION_MINOR 4 +#define OPENVPN_VERSION_PATCH "_beta1" + /* * Plug-in types. These types correspond to the set of script callbacks * supported by OpenVPN. @@ -147,7 +155,7 @@ typedef void *openvpn_plugin_handle_t; /* * For Windows (needs to be modified for MSVC) */ -#if defined(WIN32) && !defined(OPENVPN_PLUGIN_H) +#if defined(_WIN32) && !defined(OPENVPN_PLUGIN_H) # define OPENVPN_EXPORT __declspec(dllexport) #else # define OPENVPN_EXPORT @@ -208,8 +216,11 @@ struct openvpn_plugin_string_list * which identifies the SSL implementation OpenVPN is compiled * against. * + * 3 Added ovpn_version, ovpn_version_major, ovpn_version_minor + * and ovpn_version_patch to provide the runtime version of + * OpenVPN to plug-ins. */ -#define OPENVPN_PLUGINv3_STRUCTVER 2 +#define OPENVPN_PLUGINv3_STRUCTVER 3 /** * Definitions needed for the plug-in callback functions. @@ -246,7 +257,7 @@ typedef void (*plugin_vlog_t) (openvpn_plugin_log_flags_t flags, const char *format, va_list arglist) _ovpn_chk_fmt(3, 0); -#undef _ovpn_chk_fmt +/* #undef _ovpn_chk_fmt */ /** * Used by the openvpn_plugin_open_v3() function to pass callback @@ -267,13 +278,13 @@ struct openvpn_plugin_callbacks /** * Used by the openvpn_plugin_open_v3() function to indicate to the * plug-in what kind of SSL implementation OpenVPN uses. This is - * to avoid SEGV issues when OpenVPN is complied against PolarSSL + * to avoid SEGV issues when OpenVPN is complied against mbed TLS * and the plug-in against OpenSSL. */ typedef enum { SSLAPI_NONE, SSLAPI_OPENSSL, - SSLAPI_POLARSSL + SSLAPI_MBEDTLS } ovpnSSLAPI; /** @@ -304,6 +315,10 @@ struct openvpn_plugin_args_open_in const char ** const envp; struct openvpn_plugin_callbacks *callbacks; const ovpnSSLAPI ssl_api; + const char *ovpn_version; + const unsigned int ovpn_version_major; + const unsigned int ovpn_version_minor; + const char * const ovpn_version_patch; }; @@ -358,9 +373,9 @@ struct openvpn_plugin_args_open_return * *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_SSL defined) + * current_cert_depth : Certificate depth of the certificate being passed over (only if compiled with ENABLE_CRYPTO defined) * - * *current_cert : X509 Certificate object received from the client (only if compiled with ENABLE_SSL defined) + * *current_cert : X509 Certificate object received from the client (only if compiled with ENABLE_CRYPTO defined) * */ struct openvpn_plugin_args_func_in @@ -370,7 +385,7 @@ struct openvpn_plugin_args_func_in const char ** const envp; openvpn_plugin_handle_t handle; void *per_client_context; -#ifdef ENABLE_SSL +#ifdef ENABLE_CRYPTO int current_cert_depth; openvpn_x509_cert_t *current_cert; #else -- cgit v1.2.3