| 40 | #define SSL_MOD_CONFIG_KEY "ssl_module" |
| 41 | |
| 42 | SSLModConfigRec *ssl_config_global_create(server_rec *s) |
| 43 | { |
| 44 | apr_pool_t *pool = s->process->pool; |
| 45 | SSLModConfigRec *mc; |
| 46 | void *vmc; |
| 47 | |
| 48 | apr_pool_userdata_get(&vmc, SSL_MOD_CONFIG_KEY, pool); |
| 49 | if (vmc) { |
| 50 | return vmc; /* reused for lifetime of the server */ |
| 51 | } |
| 52 | |
| 53 | /* |
| 54 | * allocate an own subpool which survives server restarts |
| 55 | */ |
| 56 | mc = (SSLModConfigRec *)apr_palloc(pool, sizeof(*mc)); |
| 57 | mc->pPool = pool; |
| 58 | mc->bFixed = FALSE; |
| 59 | |
| 60 | /* |
| 61 | * initialize per-module configuration |
| 62 | */ |
| 63 | mc->sesscache_mode = SSL_SESS_CACHE_OFF; |
| 64 | mc->sesscache = NULL; |
| 65 | mc->pMutex = NULL; |
| 66 | #ifdef HAVE_TLSEXT |
| 67 | mc->snivh_policy = MODSSL_SNIVH_SECURE; |
| 68 | #endif |
| 69 | mc->aRandSeed = apr_array_make(pool, 4, |
| 70 | sizeof(ssl_randseed_t)); |
| 71 | mc->tVHostKeys = apr_hash_make(pool); |
| 72 | mc->tPrivateKey = apr_hash_make(pool); |
| 73 | #if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT) |
| 74 | mc->szCryptoDevice = NULL; |
| 75 | #endif |
| 76 | #ifdef HAVE_OCSP_STAPLING |
| 77 | mc->stapling_cache = NULL; |
| 78 | mc->stapling_cache_mutex = NULL; |
| 79 | mc->stapling_refresh_mutex = NULL; |
| 80 | #endif |
| 81 | |
| 82 | #ifdef HAVE_OPENSSL_KEYLOG |
| 83 | mc->keylog_file = NULL; |
| 84 | #endif |
| 85 | #ifdef HAVE_FIPS |
| 86 | mc->fips = UNSET; |
| 87 | #endif |
| 88 | |
| 89 | apr_pool_userdata_set(mc, SSL_MOD_CONFIG_KEY, |
| 90 | apr_pool_cleanup_null, |
| 91 | pool); |
| 92 | |
| 93 | return mc; |
| 94 | } |
| 95 | |
| 96 | void ssl_config_global_fix(SSLModConfigRec *mc) |
| 97 | { |
no outgoing calls
no test coverage detected