aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-17 07:39:41 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-17 07:39:41 +0000
commit6835555ef8ede3ac0997a0fe8365aa95391b32a3 (patch)
treec89421dd8a4f17615ad5936a11ae6e9903bc0d55 /init.c
parentVERSION 2.1_beta4 (re-released) (diff)
downloadopenvpn-6835555ef8ede3ac0997a0fe8365aa95391b32a3.tar.xz
Brought up-to-date with Alon's PKCS11 patch at
https://svn.openvpn.net/projects/openvpn/contrib/alon/BETA21/openvpn@645 Pre-2.1_beta5 git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@648 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'init.c')
-rw-r--r--init.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/init.c b/init.c
index 710a347..879c777 100644
--- a/init.c
+++ b/init.c
@@ -111,15 +111,16 @@ context_init_1 (struct context *c)
/* Certificate password input */
if (c->options.key_pass_file)
pem_password_setup (c->options.key_pass_file);
+#endif
#if defined(ENABLE_PKCS11)
{
int i;
+ init_pkcs11 (c->options.pkcs11_pin_cache_period);
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
/* Auth user/pass input */
@@ -232,13 +233,11 @@ uninit_static (void)
#ifdef USE_CRYPTO
free_ssl_lib ();
+#endif
-#ifdef USE_SSL
#ifdef ENABLE_PKCS11
free_pkcs11 ();
#endif
-#endif
-#endif
#if defined(MEASURE_TLS_HANDSHAKE_STATS) && defined(USE_CRYPTO) && defined(USE_SSL)
show_tls_performance_stats ();
@@ -375,6 +374,11 @@ possibly_become_daemon (const struct options *options, const bool first_time)
msg (M_ERR, "daemon() failed");
if (options->log)
set_std_files_to_null (true);
+
+#if defined(ENABLE_PKCS11)
+ fork_fix_pkcs11 ();
+#endif
+
ret = true;
}
return ret;