summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/openvpn-plugin.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/include/openvpn-plugin.h b/include/openvpn-plugin.h
index de54a5a..f82f61f 100644
--- a/include/openvpn-plugin.h
+++ b/include/openvpn-plugin.h
@@ -24,16 +24,25 @@
#ifndef OPENVPN_PLUGIN_H_
#define OPENVPN_PLUGIN_H_
-#ifdef USE_SSL
-# 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
+#ifdef ENABLE_SSL
+#ifdef ENABLE_CRYPTO_POLARSSL
+#include <polarssl/x509.h>
+#ifndef __OPENVPN_X509_CERT_T_DECLARED
+#define __OPENVPN_X509_CERT_T_DECLARED
+typedef x509_cert openvpn_x509_cert_t;
+#endif
+#else
+#include <openssl/x509.h>
+#ifndef __OPENVPN_X509_CERT_T_DECLARED
+#define __OPENVPN_X509_CERT_T_DECLARED
+typedef X509 openvpn_x509_cert_t;
+#endif
+#endif
+#endif
+
/*
* Plug-in types. These types correspond to the set of script callbacks
* supported by OpenVPN.
@@ -268,9 +277,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 USE_SSL defined)
+ * current_cert_depth : Certificate depth of the certificate being passed over (only if compiled with ENABLE_SSL defined)
*
- * *current_cert : X509 Certificate object received from the client (only if compiled with USE_SSL defined)
+ * *current_cert : X509 Certificate object received from the client (only if compiled with ENABLE_SSL defined)
*
*/
struct openvpn_plugin_args_func_in
@@ -280,9 +289,9 @@ struct openvpn_plugin_args_func_in
const char ** const envp;
openvpn_plugin_handle_t handle;
void *per_client_context;
-#ifdef ENABLE_SSL_PLUGIN
+#ifdef ENABLE_SSL
int current_cert_depth;
- x509_cert_t *current_cert;
+ openvpn_x509_cert_t *current_cert;
#else
int __current_cert_depth_disabled; /* Unused, for compatibility purposes only */
void *__current_cert_disabled; /* Unused, for compatibility purposes only */