0
0
mirror of https://github.com/OpenVPN/openvpn.git synced 2024-09-20 03:52:28 +02:00

Further improvements to plugin support:

- Renamed struct entries to explicitly show them as disabled
 - Added a warning if USE_SSL is enabled, but neither ssl_verify_openssl.h or ssl_verify_polarssl.h is included
 - If neither of those files is included, disable ssl support for a plugin including openvpn-plugin.h

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
This commit is contained in:
Adriaan de Jong 2011-07-07 10:05:32 +02:00 committed by David Sommerseth
parent 1876ccd012
commit bcedab1f49
3 changed files with 15 additions and 11 deletions

View File

@ -24,15 +24,12 @@
#ifndef OPENVPN_PLUGIN_H_
#define OPENVPN_PLUGIN_H_
#ifdef USE_SSL
#if defined(USE_OPENSSL)
#include "ssl_verify_openssl.h"
#elif defined(USE_POLARSSL)
#include "ssl_verify_polarssl.h"
#else
#error "Either USE_OPENSSL or USE_POLARSSL should be defined"
#endif
# if defined(SSL_VERIFY_OPENSSL_H_) || defined(SSL_VERIFY_POLARSSL_H_)
# define ENABLE_SSL_PLUGIN
# else
# warning "Neither OpenSSL or PoLarSSL headers included, disabling plugin's SSL support"
# endif
#endif /*USE_SSL*/
#define OPENVPN_PLUGIN_VERSION 3
@ -282,12 +279,12 @@ struct openvpn_plugin_args_func_in
const char ** const envp;
openvpn_plugin_handle_t handle;
void *per_client_context;
#ifdef USE_SSL
#ifdef ENABLE_SSL_PLUGIN
int current_cert_depth;
x509_cert_t *current_cert;
#else
int current_cert_depth; /* Unused, for compatibility purposes only */
void *current_cert; /* Unused, for compatibility purposes only */
int __current_cert_depth_disabled; /* Unused, for compatibility purposes only */
void *__current_cert_disabled; /* Unused, for compatibility purposes only */
#endif
};

View File

@ -29,6 +29,12 @@
#ifndef OPENVPN_PLUGIN_H
#define OPENVPN_PLUGIN_H
#ifdef USE_OPENSSL
#include "ssl_verify_openssl.h"
#endif
#ifdef USE_POLARSSL
#include "ssl_verify_polarssl.h"
#endif
#include "openvpn-plugin.h"
#ifdef ENABLE_PLUGIN

View File

@ -38,6 +38,7 @@
#define USE_SSL
#define USE_OPENSSL
#include "ssl_verify_openssl.h"
#include "openvpn-plugin.h"