ssl_engine_config.c revision 1e046c430fedc2d319088d925fd044710b3596b9
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis/* Licensed to the Apache Software Foundation (ASF) under one or more
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * contributor license agreements. See the NOTICE file distributed with
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * this work for additional information regarding copyright ownership.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * The ASF licenses this file to You under the Apache License, Version 2.0
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * (the "License"); you may not use this file except in compliance with
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * the License. You may obtain a copy of the License at
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * http://www.apache.org/licenses/LICENSE-2.0
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Unless required by applicable law or agreed to in writing, software
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * distributed under the License is distributed on an "AS IS" BASIS,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * See the License for the specific language governing permissions and
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * limitations under the License.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * _ __ ___ ___ __| | ___ ___| | mod_ssl
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * | '_ ` _ \ / _ \ / _` | / __/ __| | Apache Interface to OpenSSL
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * | | | | | | (_) | (_| | \__ \__ \ |
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * |_| |_| |_|\___/ \__,_|___|___/___/_|
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Apache Configuration Directives
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis /* ``Damned if you do,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis damned if you don't.''
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis/* _________________________________________________________________
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis** Support for Global Configuration
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis** _________________________________________________________________
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr JasiukajtisSSLModConfigRec *ssl_config_global_create(server_rec *s)
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis apr_pool_userdata_get(&vmc, SSL_MOD_CONFIG_KEY, pool);
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis return vmc; /* reused for lifetime of the server */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * allocate an own subpool which survives server restarts
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis mc = (SSLModConfigRec *)apr_palloc(pool, sizeof(*mc));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * initialize per-module configuration
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis memset(mc->pTmpKeys, 0, sizeof(mc->pTmpKeys));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis apr_pool_userdata_set(mc, SSL_MOD_CONFIG_KEY,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisvoid ssl_config_global_fix(SSLModConfigRec *mc)
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr JasiukajtisBOOL ssl_config_global_isfixed(SSLModConfigRec *mc)
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis/* _________________________________________________________________
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis** Configuration handling
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis** _________________________________________________________________
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisstatic void modssl_ctx_init(modssl_ctx_t *mctx)
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis mctx->sc = NULL; /* set during module init */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis mctx->ssl_ctx = NULL; /* set during module init */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis mctx->pphrase_dialog_type = SSL_PPTYPE_UNSET;
apr_pool_t *p)
apr_pool_t *p)
return sc;
return sc;
for (i = 0; i < SSL_AIDX_MAX; i++) {
return mrg;
return dc;
return mrg;
void *dcfg,
const char *arg_)
const char *err;
return err;
return NULL;
return NULL;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
ENGINE *e;
return err;
ENGINE_free(e);
e = ENGINE_get_first();
ENGINE_free(e);
e = en;
return err;
return NULL;
void *dcfg,
const char *arg1,
const char *arg2,
const char *arg3)
const char *err;
return err;
return NULL;
NULL);
#ifdef HAVE_SSL_RAND_EGD
if (!arg3) {
return NULL;
return NULL;
return NULL;
return NULL;
void *dcfg,
const char *arg)
return NULL;
#define SSL_FLAGS_CHECK_FILE \
#define SSL_FLAGS_CHECK_DIR \
const char **file)
if (!filepath) {
return NULL;
return NULL;
const char **dir)
if (!dirpath) {
return NULL;
const char *arg,
int idx)
return err;
switch (idx) {
case SSL_AIDX_CERTS:
case SSL_AIDX_KEYS:
for (i = 0; i < SSL_AIDX_MAX; i++) {
if (!files[i]) {
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
#define NO_PER_DIR_SSL_CA \
#ifdef HAVE_SSL_SET_CERT_STORE
# define MODSSL_HAVE_SSL_SET_CERT_STORE 0
#define MODSSL_SET_CA(f) \
return NO_PER_DIR_SSL_CA; \
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
const char *arg)
const char *err;
return err;
return NULL;
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
const char *arg,
NULL);
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
const char *arg,
int *depth)
return NULL;
NULL);
void *dcfg,
const char *arg)
int depth;
const char *err;
return err;
return NULL;
#define MODSSL_NO_SHARED_MEMORY_ERROR \
void *dcfg,
const char *arg)
long enabled_flags;
return err;
return NULL;
name,
const char *all_names;
arg);
if (err) {
return NULL;
void *dcfg,
const char *arg)
return NULL;
void *dcfg,
const char *arg)
NULL);
return NULL;
void *dcfg,
const char *arg)
char action, *w;
while (*arg) {
action = *(w++);
else if (first) {
NULL);
return NULL;
return NULL;
void *dcfg,
const char *arg)
return NULL;
const char *arg,
while (*arg) {
action = *(w++);
return NULL;
void *dcfg,
const char *arg)
return NULL;
void *dcfg,
const char *arg)
void *dcfg,
const char *arg)
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
int depth;
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
void *dcfg,
const char *arg)
const char *err;
return err;
return NULL;
const char *arg)
return NULL;
#ifndef HAVE_OCSP
if (flag) {
return NULL;
return NULL;
return NULL;
s = s->next;