aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-13 08:38:41 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-13 08:38:41 +0000
commitce98fd24bd72d479805cb121ca8e118826f1ed76 (patch)
treeb109113870455d2c5595a0833301f234353578e3 /init.c
parentRenamed plugin to plugins to work around (diff)
downloadopenvpn-ce98fd24bd72d479805cb121ca8e118826f1ed76.tar.xz
Merged PKCS#11 patch.
Pre-2.1_beta3 git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@604 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'init.c')
-rw-r--r--init.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/init.c b/init.c
index a0fce65..710a347 100644
--- a/init.c
+++ b/init.c
@@ -38,6 +38,7 @@
#include "otime.h"
#include "pool.h"
#include "gremlin.h"
+#include "pkcs11.h"
#include "memdbg.h"
@@ -110,6 +111,14 @@ context_init_1 (struct context *c)
/* Certificate password input */
if (c->options.key_pass_file)
pem_password_setup (c->options.key_pass_file);
+
+#if defined(ENABLE_PKCS11)
+ {
+ int i;
+ for (i=0;i<MAX_PARMS && c->options.pkcs11_providers[i] != NULL;i++)
+ add_pkcs11 (c->options.pkcs11_providers[i], c->options.pkcs11_sign_mode[i]);
+ }
+#endif
#endif
#if P2MP
@@ -223,6 +232,12 @@ uninit_static (void)
#ifdef USE_CRYPTO
free_ssl_lib ();
+
+#ifdef USE_SSL
+#ifdef ENABLE_PKCS11
+ free_pkcs11 ();
+#endif
+#endif
#endif
#if defined(MEASURE_TLS_HANDSHAKE_STATS) && defined(USE_CRYPTO) && defined(USE_SSL)