summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2012-02-29 22:12:10 +0200
committerDavid Sommerseth <davids@redhat.com>2012-03-22 22:53:39 +0100
commit9b33b5a4b1aa170080d18b0f32f6599b519589f0 (patch)
treebf033b98d14a56d7adb18d3345be2a94df850c0d /include
parent74bbc71b75bac49f5c9df81827fa184b8a365d36 (diff)
downloadopenvpn-9b33b5a4b1aa170080d18b0f32f6599b519589f0.tar.gz
openvpn-9b33b5a4b1aa170080d18b0f32f6599b519589f0.tar.xz
openvpn-9b33b5a4b1aa170080d18b0f32f6599b519589f0.zip
build: proper crypto detection and usage
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Signed-off-by: David Sommerseth <davids@redhat.com>
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 */