diff options
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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; |