ssl_scache_dc.c revision 160bda047cd72fec58224f4eaa0647cb9095d868
/* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* _ _
* _ __ ___ ___ __| | ___ ___| | mod_ssl
* | '_ ` _ \ / _ \ / _` | / __/ __| | Apache Interface to OpenSSL
* | | | | | | (_) | (_| | \__ \__ \ |
* |_| |_| |_|\___/ \__,_|___|___/___/_|
* |_____|
* Distributed Session Cache (client support)
*/
#include "ssl_private.h"
/* Only build this code if it's enabled at configure-time. */
#ifdef HAVE_DISTCACHE
#include "distcache/dc_client.h"
#error "You must compile with a more recent version of the distcache-base package"
#endif
/*
* This cache implementation allows modssl to access 'distcache' servers (or
* proxies) to facilitate distributed session caching. It is based on code
* released as open source by Cryptographic Appliances Inc, and was developed by
* Geoff Thorpe, Steve Robb, and Chris Zimmerman.
*/
/*
**
** High-Level "handlers" as per ssl_scache.c
**
*/
{
/*
* Create a session context
*/
ssl_die();
}
#if 0
/* If a "persistent connection" mode of operation is preferred, you *must*
* also use the PIDCHECK flag to ensure fork()'d processes don't interlace
* comms on the same connection as each other. */
#define SESSION_CTX_FLAGS SESSION_CTX_FLAG_PERSISTENT | \
#else
/* This mode of operation will open a temporary connection to the 'target'
* for each cache operation - this makes it safe against fork()
* automatically. This mode is preferred when running a local proxy (over
* unix domain sockets) because overhead is negligable and it reduces the
* performance/stability danger of file-descriptor bloatage. */
#define SESSION_CTX_FLAGS 0
#endif
if (!ctx) {
ssl_die();
}
/*
* Success ...
*/
return;
}
void ssl_scache_dc_kill(server_rec *s)
{
if (mc->tSessionCacheDataTable)
}
{
unsigned char der[SSL_SESSION_MAX_DER];
int der_len;
/* Serialise the SSL_SESSION object */
return FALSE;
/* !@#$%^ - why do we deal with *absolute* time anyway??? */
/* Send the serialised session to the distributed cache context */
(unsigned long)timeout * 1000)) {
return FALSE;
}
return TRUE;
}
{
unsigned char der[SSL_SESSION_MAX_DER];
unsigned int der_len;
/* Retrieve any corresponding session from the distributed cache context */
&der_len)) {
return NULL;
}
if (der_len > SSL_SESSION_MAX_DER) {
return NULL;
}
if (!pSession) {
return NULL;
}
return pSession;
}
{
/* Remove any corresponding session from the distributed cache context */
} else {
}
}
{
"distributed scache 'ssl_scache_dc_status'");
ap_rprintf(r, "cache type: <b>DC (Distributed Cache)</b>, "
}
#endif