ssl_engine_config.c revision 6ace32dacb8313226eb9019275d0e4fa45a15148
/* _ _
** _ __ ___ ___ __| | ___ ___| | mod_ssl
** | '_ ` _ \ / _ \ / _` | / __/ __| | Apache Interface to OpenSSL
** | | | | | | (_) | (_| | \__ \__ \ | www.modssl.org
** |_| |_| |_|\___/ \__,_|___|___/___/_| ftp.modssl.org
** |_____|
** Apache Configuration Directives
*/
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
/* ``Damned if you do,
damned if you don't.''
-- Unknown */
#if 0 /* XXX */
#include "mod_ssl.h"
/* _________________________________________________________________
**
** Support for Global Configuration
** _________________________________________________________________
*/
void ssl_hook_AddModule(module *m)
{
if (m == &ssl_module) {
/*
* Announce us for the configuration files
*/
ap_add_config_define("MOD_SSL");
/*
* Link ourself into the Apache kernel
*/
#if defined(SSL_VENDOR) && defined(SSL_VENDOR_OBJS)
#endif
}
return;
}
void ssl_hook_RemoveModule(module *m)
{
if (m == &ssl_module) {
/*
* Unlink ourself from the Apache kernel
*/
#if defined(SSL_VENDOR) && defined(SSL_VENDOR_OBJS)
#endif
}
return;
}
void ssl_config_global_create(void)
{
/*
* allocate an own subpool which survives server restarts
*/
/*
* initialize per-module configuration
*/
mc->nInitCount = 0;
mc->nSessionCacheDataSize = 0;
#ifdef SSL_EXPERIMENTAL_ENGINE
#endif
#ifdef SSL_VENDOR
ap_hook_use("ap::mod_ssl::vendor::config_global_create",
#endif
/*
* And push it into Apache's global context
*/
}
return;
}
void ssl_config_global_fix(void)
{
return;
}
{
}
/* _________________________________________________________________
**
** Configuration handling
** _________________________________________________________________
*/
/*
* Create per-server SSL configuration
*/
{
#ifdef SSL_EXPERIMENTAL_PROXY
#endif
#ifdef SSL_VENDOR
ap_hook_use("ap::mod_ssl::vendor::config_server_create",
p, s, sc);
#endif
return sc;
}
/*
* Merge per-server SSL configurations
*/
{
int i;
for (i = 0; i < SSL_AIDX_MAX; i++) {
}
#ifdef SSL_VENDOR
ap_hook_use("ap::mod_ssl::vendor::config_server_merge",
#endif
#ifdef SSL_EXPERIMENTAL_PROXY
#endif
return new;
}
/*
* Create per-directory SSL configuration
*/
{
#ifdef SSL_EXPERIMENTAL_PERDIRCA
#endif
#ifdef SSL_VENDOR
ap_hook_use("ap::mod_ssl::vendor::config_perdir_create",
#endif
return dc;
}
/*
* Merge per-directory SSL configurations
*/
{
sizeof(SSLDirConfigRec));
}
else {
}
#ifdef SSL_EXPERIMENTAL_PERDIRCA
#endif
#ifdef SSL_VENDOR
ap_hook_use("ap::mod_ssl::vendor::config_perdir_merge",
#endif
return new;
}
/*
* Directive Rewriting
*/
{
#ifdef SSL_COMPAT
#else
return NULL;
#endif
}
/*
* Configuration functions for particular directives
*/
const char *ssl_cmd_SSLMutex(
{
const char *err;
return err;
if (ssl_config_global_isfixed())
return NULL;
}
#ifndef WIN32
(unsigned long)getpid());
#else
return "SSLMutex: Lockfiles not available on this platform";
#endif
}
#ifdef SSL_CAN_USE_SEM
#else
return "SSLMutex: Semaphores not available on this platform";
#endif
}
else
return "SSLMutex: Invalid argument";
return NULL;
}
const char *ssl_cmd_SSLPassPhraseDialog(
{
const char *err;
return err;
}
}
else
return "SSLPassPhraseDialog: Invalid argument";
return NULL;
}
#ifdef SSL_EXPERIMENTAL_ENGINE
const char *ssl_cmd_SSLCryptoDevice(
{
const char *err;
ENGINE *e;
#if SSL_LIBRARY_VERSION >= 0x00907000
static int loaded_engines = FALSE;
/* early loading to make sure the engines are already
available for ENGINE_by_id() above... */
if (!loaded_engines) {
}
#endif
return err;
}
ENGINE_free(e);
}
else
return "SSLCryptoDevice: Invalid argument";
return NULL;
}
#endif
const char *ssl_cmd_SSLRandomSeed(
{
const char *err;
return err;
if (ssl_config_global_isfixed())
return NULL;
else
}
}
#if SSL_LIBRARY_VERSION >= 0x00905100
}
#endif
}
else {
}
else {
return "SSLRandomSeed: byte specification not "
"allowed for builtin seed source";
return "SSLRandomSeed: invalid number of bytes specified";
}
return NULL;
}
const char *ssl_cmd_SSLEngine(
{
return NULL;
}
const char *ssl_cmd_SSLCipherSuite(
{
else
return NULL;
}
const char *ssl_cmd_SSLCertificateFile(
{
char *cpPath;
int i;
;
if (i == SSL_AIDX_MAX)
"different certificates per virtual host allowed",
return NULL;
}
const char *ssl_cmd_SSLCertificateKeyFile(
{
char *cpPath;
int i;
;
if (i == SSL_AIDX_MAX)
"different private keys per virtual host allowed",
return NULL;
}
const char *ssl_cmd_SSLCertificateChainFile(
{
char *cpPath;
return NULL;
}
const char *ssl_cmd_SSLCACertificatePath(
{
char *cpPath;
#ifdef SSL_EXPERIMENTAL_PERDIRCA
else
#else
#endif
return NULL;
}
const char *ssl_cmd_SSLCACertificateFile(
{
char *cpPath;
#ifdef SSL_EXPERIMENTAL_PERDIRCA
else
#else
#endif
return NULL;
}
const char *ssl_cmd_SSLCARevocationPath(
{
char *cpPath;
return NULL;
}
const char *ssl_cmd_SSLCARevocationFile(
{
char *cpPath;
return NULL;
}
const char *ssl_cmd_SSLVerifyClient(
{
else
return "SSLVerifyClient: Invalid argument";
else
return NULL;
}
const char *ssl_cmd_SSLVerifyDepth(
{
int d;
if (d < 0)
return "SSLVerifyDepth: Invalid argument";
sc->nVerifyDepth = d;
else
dc->nVerifyDepth = d;
return NULL;
}
const char *ssl_cmd_SSLSessionCache(
{
const char *err;
int maxsize;
return err;
if (ssl_config_global_isfixed())
return NULL;
}
}
if (!ap_mm_useable())
return "SSLSessionCache: shared memory cache not useable on this platform";
return "SSLSessionCache: Invalid argument: no closing parenthesis";
return "SSLSessionCache: Invalid argument: size has to be >= 8192 bytes";
"size has to be < %d bytes on this platform", maxsize);
}
}
if (!ap_mm_useable())
return "SSLSessionCache: shared memory cache not useable on this platform";
return "SSLSessionCache: Invalid argument: no closing parenthesis";
return "SSLSessionCache: Invalid argument: size has to be >= 8192 bytes";
"size has to be < %d bytes on this platform", maxsize);
}
}
else
#ifdef SSL_VENDOR
if (!ap_hook_use("ap::mod_ssl::vendor::cmd_sslsessioncache",
#endif
return "SSLSessionCache: Invalid argument";
return NULL;
}
const char *ssl_cmd_SSLSessionCacheTimeout(
{
if (sc->nSessionCacheTimeout < 0)
return "SSLSessionCacheTimeout: Invalid argument";
return NULL;
}
const char *ssl_cmd_SSLLog(
{
const char *err;
return err;
return NULL;
}
const char *ssl_cmd_SSLLogLevel(
{
const char *err;
return err;
else
return "SSLLogLevel: Invalid argument";
return NULL;
}
const char *ssl_cmd_SSLOptions(
{
int first;
char action;
char *w;
if (*w == '+' || *w == '-') {
action = *(w++);
}
else if (first) {
}
if (strcEQ(w, "StdEnvVars"))
else if (strcEQ(w, "CompatEnvVars"))
else if (strcEQ(w, "ExportCertData"))
else if (strcEQ(w, "FakeBasicAuth"))
else if (strcEQ(w, "StrictRequire"))
else if (strcEQ(w, "OptRenegotiate"))
else
if (action == '-') {
}
else if (action == '+') {
}
else {
}
}
return NULL;
}
const char *ssl_cmd_SSLRequireSSL(
{
return NULL;
}
const char *ssl_cmd_SSLRequire(
{
return NULL;
}
const char *ssl_cmd_SSLProtocol(
{
char action;
char *w;
if (*w == '+' || *w == '-')
action = *(w++);
if (strcEQ(w, "SSLv2"))
else if (strcEQ(w, "SSLv3"))
else if (strcEQ(w, "TLSv1"))
else if (strcEQ(w, "all"))
else
if (action == '-')
else if (action == '+')
else
}
return NULL;
}
#ifdef SSL_EXPERIMENTAL_PROXY
const char *ssl_cmd_SSLProxyProtocol(
{
char action;
char *w;
if (*w == '+' || *w == '-')
action = *(w++);
if (strcEQ(w, "SSLv2"))
else if (strcEQ(w, "SSLv3"))
else if (strcEQ(w, "TLSv1"))
else if (strcEQ(w, "all"))
else
if (action == '-')
else if (action == '+')
else
}
return NULL;
}
const char *ssl_cmd_SSLProxyCipherSuite(
{
return NULL;
}
const char *ssl_cmd_SSLProxyVerify(
{
return NULL;
}
const char *ssl_cmd_SSLProxyVerifyDepth(
{
int d;
if (d < 0)
return "SSLProxyVerifyDepth: Invalid argument";
sc->nProxyVerifyDepth = d;
return NULL;
}
const char *ssl_cmd_SSLProxyCACertificateFile(
{
char *cpPath;
return NULL;
}
const char *ssl_cmd_SSLProxyCACertificatePath(
{
char *cpPath;
return NULL;
}
const char *ssl_cmd_SSLProxyMachineCertificateFile(
{
char *cpPath;
return NULL;
}
const char *ssl_cmd_SSLProxyMachineCertificatePath(
{
char *cpPath;
return NULL;
}
#endif /* SSL_EXPERIMENTAL_PROXY */
#endif /* XXX */