From ce98fd24bd72d479805cb121ca8e118826f1ed76 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 13 Oct 2005 08:38:41 +0000 Subject: 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 --- init.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'init.c') 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;ioptions.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) -- cgit v1.2.3