aboutsummaryrefslogtreecommitdiff
path: root/plugin.c
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-12-10 01:16:09 +0100
committerDavid Sommerseth <davids@redhat.com>2011-03-25 09:38:48 +0100
commit81c97a5e2230af757c22e77cc2db129416694ee6 (patch)
treea88aeca7b39a762655851372cfd934106f998c23 /plugin.c
parentImplement the core v3 plug-in function calls. (diff)
downloadopenvpn-81c97a5e2230af757c22e77cc2db129416694ee6.tar.xz
Extend the v3 plug-in API to send over X509 certificates
The certificates sent to the plug-in API will only happen during the OPENVPN_PLUGIN_TLS_VERIFY phase and will contain a pointer to the OpenSSL X509 certificate data. Signed-off-by: David Sommerseth <dazo@users.sourceforge.net> Acked-by: James Yonan <james@openvpn.net>
Diffstat (limited to '')
-rw-r--r--plugin.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/plugin.c b/plugin.c
index ae5b98a..03e7df3 100644
--- a/plugin.c
+++ b/plugin.c
@@ -345,7 +345,9 @@ plugin_call_item (const struct plugin *p,
const int type,
const struct argv *av,
struct openvpn_plugin_string_list **retlist,
- const char **envp)
+ const char **envp,
+ int certdepth,
+ X509 *current_cert)
{
int status = OPENVPN_PLUGIN_FUNC_SUCCESS;
@@ -369,7 +371,9 @@ plugin_call_item (const struct plugin *p,
.argv = (const char **) a.argv,
.envp = envp,
.handle = p->plugin_handle,
- .per_client_context = per_client_context };
+ .per_client_context = per_client_context,
+ .current_cert_depth = (current_cert ? certdepth : -1),
+ .current_cert = current_cert };
struct openvpn_plugin_args_func_return retargs;
CLEAR(retargs);
@@ -570,7 +574,9 @@ plugin_call (const struct plugin_list *pl,
const int type,
const struct argv *av,
struct plugin_return *pr,
- struct env_set *es)
+ struct env_set *es,
+ int certdepth,
+ X509 *current_cert)
{
if (pr)
plugin_return_init (pr);
@@ -595,7 +601,8 @@ plugin_call (const struct plugin_list *pl,
type,
av,
pr ? &pr->list[i] : NULL,
- envp);
+ envp,
+ certdepth, current_cert);
switch (status)
{
case OPENVPN_PLUGIN_FUNC_SUCCESS: