summaryrefslogtreecommitdiffstats
path: root/plugin.c
diff options
context:
space:
mode:
authorAdriaan de Jong <dejong@fox-it.com>2011-07-07 09:21:03 +0200
committerDavid Sommerseth <davids@redhat.com>2011-10-22 17:22:51 +0200
commit1876ccd012e9e2ca6f8e1cd9e7e9bb4bf24ccecb (patch)
tree4ccb3c4e2c142dce66a95fef769af1196ba734e5 /plugin.c
parent557624e0a7282cf31cd3b58f8155f11f0517f254 (diff)
downloadopenvpn-1876ccd012e9e2ca6f8e1cd9e7e9bb4bf24ccecb.tar.gz
openvpn-1876ccd012e9e2ca6f8e1cd9e7e9bb4bf24ccecb.tar.xz
openvpn-1876ccd012e9e2ca6f8e1cd9e7e9bb4bf24ccecb.zip
Fixes for the plugin system:
- Removed the dependency on an SSL library for USE_SSL when creating non-SSL plugins - Fixed example plugin code to include USE_SSL when needed 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>
Diffstat (limited to 'plugin.c')
-rw-r--r--plugin.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/plugin.c b/plugin.c
index 6cbf6a0..737a868 100644
--- a/plugin.c
+++ b/plugin.c
@@ -345,9 +345,12 @@ plugin_call_item (const struct plugin *p,
const int type,
const struct argv *av,
struct openvpn_plugin_string_list **retlist,
- const char **envp,
- int certdepth,
- x509_cert_t *current_cert)
+ const char **envp
+#ifdef USE_SSL
+ , int certdepth,
+ x509_cert_t *current_cert
+#endif
+ )
{
int status = OPENVPN_PLUGIN_FUNC_SUCCESS;
@@ -372,8 +375,15 @@ plugin_call_item (const struct plugin *p,
(const char ** const) envp,
p->plugin_handle,
per_client_context,
- (current_cert ? certdepth : -1),
- current_cert };
+#ifdef USE_SSL
+ (current_cert ? certdepth : -1),
+ current_cert
+#else
+ -1,
+ NULL
+#endif
+ };
+
struct openvpn_plugin_args_func_return retargs;
CLEAR(retargs);
@@ -570,13 +580,16 @@ plugin_list_open (struct plugin_list *pl,
}
int
-plugin_call (const struct plugin_list *pl,
+plugin_call_ssl (const struct plugin_list *pl,
const int type,
const struct argv *av,
struct plugin_return *pr,
- struct env_set *es,
- int certdepth,
- x509_cert_t *current_cert)
+ struct env_set *es
+#ifdef USE_SSL
+ , int certdepth,
+ x509_cert_t *current_cert
+#endif
+ )
{
if (pr)
plugin_return_init (pr);
@@ -601,8 +614,12 @@ plugin_call (const struct plugin_list *pl,
type,
av,
pr ? &pr->list[i] : NULL,
- envp,
- certdepth, current_cert);
+ envp
+#ifdef USE_SSL
+ ,certdepth,
+ current_cert
+#endif
+ );
switch (status)
{
case OPENVPN_PLUGIN_FUNC_SUCCESS: