summaryrefslogtreecommitdiff
path: root/src/openvpn/plugin.c
diff options
context:
space:
mode:
authorBernhard Schmidt <berni@debian.org>2020-09-01 16:52:17 +0200
committerBernhard Schmidt <berni@debian.org>2020-09-01 16:52:17 +0200
commit9fc3b98112217f2d92a67977dbde0987cc7a1803 (patch)
tree29fcc8654ee65d9dd89ade797bea2f3d9dfd9cfd /src/openvpn/plugin.c
parenta8758c0e03eed188dcb9da0e4fd781a67c25bf1e (diff)
parent69b02b1f7fd609d84ace13ab04697158de2418a9 (diff)
Merge branch 'debian/experimental-2.5'
Diffstat (limited to 'src/openvpn/plugin.c')
-rw-r--r--src/openvpn/plugin.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/src/openvpn/plugin.c b/src/openvpn/plugin.c
index 0ab99ab..8b351c4 100644
--- a/src/openvpn/plugin.c
+++ b/src/openvpn/plugin.c
@@ -104,6 +104,12 @@ plugin_type_name(const int type)
case OPENVPN_PLUGIN_CLIENT_CONNECT_V2:
return "PLUGIN_CLIENT_CONNECT";
+ case OPENVPN_PLUGIN_CLIENT_CONNECT_DEFER:
+ return "PLUGIN_CLIENT_CONNECT_DEFER";
+
+ case OPENVPN_PLUGIN_CLIENT_CONNECT_DEFER_V2:
+ return "PLUGIN_CLIENT_CONNECT_DEFER_V2";
+
case OPENVPN_PLUGIN_CLIENT_DISCONNECT:
return "PLUGIN_CLIENT_DISCONNECT";
@@ -161,12 +167,13 @@ plugin_option_list_new(struct gc_arena *gc)
}
bool
-plugin_option_list_add(struct plugin_option_list *list, char **p, struct gc_arena *gc)
+plugin_option_list_add(struct plugin_option_list *list, char **p,
+ struct gc_arena *gc)
{
if (list->n < MAX_PLUGINS)
{
struct plugin_option *o = &list->plugins[list->n++];
- o->argv = make_extended_arg_array(p, gc);
+ o->argv = make_extended_arg_array(p, false, gc);
if (o->argv[0])
{
o->so_pathname = o->argv[0];
@@ -250,7 +257,7 @@ plugin_init_item(struct plugin *p, const struct plugin_option *o)
* was parsed.
*
*/
- if (!absolute_pathname(p->so_pathname)
+ if (!platform_absolute_pathname(p->so_pathname)
&& p->so_pathname[0] != '.')
{
char full[PATH_MAX];
@@ -260,7 +267,7 @@ plugin_init_item(struct plugin *p, const struct plugin_option *o)
}
else
{
- rel = !absolute_pathname(p->so_pathname);
+ rel = !platform_absolute_pathname(p->so_pathname);
p->handle = dlopen(p->so_pathname, RTLD_NOW);
}
if (!p->handle)
@@ -272,7 +279,7 @@ plugin_init_item(struct plugin *p, const struct plugin_option *o)
#else /* ifndef _WIN32 */
- rel = !absolute_pathname(p->so_pathname);
+ rel = !platform_absolute_pathname(p->so_pathname);
p->module = LoadLibraryW(wide_string(p->so_pathname, &gc));
if (!p->module)
{
@@ -520,11 +527,9 @@ plugin_call_item(const struct plugin *p,
const int type,
const struct argv *av,
struct openvpn_plugin_string_list **retlist,
- const char **envp
-#ifdef ENABLE_CRYPTO
- , int certdepth,
+ const char **envp,
+ int certdepth,
openvpn_x509_cert_t *current_cert
-#endif
)
{
int status = OPENVPN_PLUGIN_FUNC_SUCCESS;
@@ -553,14 +558,8 @@ plugin_call_item(const struct plugin *p,
(const char **const) envp,
p->plugin_handle,
per_client_context,
-#ifdef ENABLE_CRYPTO
(current_cert ? certdepth : -1),
- current_cert
-#else
- -1,
- NULL
-#endif
- };
+ current_cert };
struct openvpn_plugin_args_func_return retargs;
@@ -594,7 +593,7 @@ plugin_call_item(const struct plugin *p,
p->so_pathname);
}
- argv_reset(&a);
+ argv_free(&a);
gc_free(&gc);
}
return status;
@@ -789,11 +788,9 @@ plugin_call_ssl(const struct plugin_list *pl,
const int type,
const struct argv *av,
struct plugin_return *pr,
- struct env_set *es
-#ifdef ENABLE_CRYPTO
- , int certdepth,
+ struct env_set *es,
+ int certdepth,
openvpn_x509_cert_t *current_cert
-#endif
)
{
if (pr)
@@ -821,11 +818,9 @@ plugin_call_ssl(const struct plugin_list *pl,
type,
av,
pr ? &pr->list[i] : NULL,
- envp
-#ifdef ENABLE_CRYPTO
- ,certdepth,
+ envp,
+ certdepth,
current_cert
-#endif
);
switch (status)
{