Apache HTTPD
Macros | Functions | Variables
tls_cache.c File Reference
module tls_module
#include <assert.h>
#include <apr_lib.h>
#include <apr_strings.h>
#include <apr_hash.h>
#include <httpd.h>
#include <http_connection.h>
#include <http_log.h>
#include <ap_socache.h>
#include <util_mutex.h>
#include <rustls.h>
#include "tls_conf.h"
#include "tls_core.h"
#include "tls_cache.h"

Go to the source code of this file.

Macros

#define TLS_CACHE_DEF_PROVIDER   "shmcb"
 
#define TLS_CACHE_DEF_DIR   "tls"
 
#define TLS_CACHE_DEF_FILE   "session_cache"
 
#define TLS_CACHE_DEF_SIZE   512000
 

Functions

static const charcache_provider_unknown (const char *name, apr_pool_t *p)
 
void tls_cache_pre_config (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
 
static const charcache_init (tls_conf_global_t *gconf, apr_pool_t *p, apr_pool_t *ptemp)
 
const chartls_cache_set_specification (const char *spec, tls_conf_global_t *gconf, apr_pool_t *p, apr_pool_t *ptemp)
 
apr_status_t tls_cache_post_config (apr_pool_t *p, apr_pool_t *ptemp, server_rec *s)
 
void tls_cache_init_child (apr_pool_t *p, server_rec *s)
 
void tls_cache_free (server_rec *s)
 
static void tls_cache_lock (tls_conf_global_t *gconf)
 
static void tls_cache_unlock (tls_conf_global_t *gconf)
 
static rustls_result tls_cache_get (void *userdata, const rustls_slice_bytes *key, int remove_after, unsigned char *buf, size_t count, size_t *out_n)
 
static rustls_result tls_cache_put (void *userdata, const rustls_slice_bytes *key, const rustls_slice_bytes *val)
 
apr_status_t tls_cache_init_server (rustls_server_config_builder *builder, server_rec *s)
 

Variables

static int *const aplog_module_index = &( tls_module.module_index)
 

Macro Definition Documentation

◆ TLS_CACHE_DEF_DIR

#define TLS_CACHE_DEF_DIR   "tls"

Definition at line 37 of file tls_cache.c.

◆ TLS_CACHE_DEF_FILE

#define TLS_CACHE_DEF_FILE   "session_cache"

Definition at line 38 of file tls_cache.c.

◆ TLS_CACHE_DEF_PROVIDER

#define TLS_CACHE_DEF_PROVIDER   "shmcb"

Definition at line 36 of file tls_cache.c.

◆ TLS_CACHE_DEF_SIZE

#define TLS_CACHE_DEF_SIZE   512000

Definition at line 39 of file tls_cache.c.

Function Documentation

◆ cache_init()

static const char * cache_init ( tls_conf_global_t gconf,
apr_pool_t p,
apr_pool_t ptemp 
)
static

Definition at line 65 of file tls_cache.c.

◆ cache_provider_unknown()

static const char * cache_provider_unknown ( const char name,
apr_pool_t p 
)
static

Definition at line 41 of file tls_cache.c.

◆ tls_cache_free()

void tls_cache_free ( server_rec s)

Free all cache related resources.

Definition at line 189 of file tls_cache.c.

◆ tls_cache_get()

static rustls_result tls_cache_get ( void *  userdata,
const rustls_slice_bytes key,
int  remove_after,
unsigned char buf,
size_t  count,
size_t out_n 
)
static

Definition at line 219 of file tls_cache.c.

◆ tls_cache_init_child()

void tls_cache_init_child ( apr_pool_t p,
server_rec s 
)

Started a new child, make sure that global mutex we might use is set up.

Definition at line 172 of file tls_cache.c.

◆ tls_cache_init_server()

apr_status_t tls_cache_init_server ( rustls_server_config_builder builder,
server_rec s 
)

Initialize the session store for the server's config builder.

Definition at line 299 of file tls_cache.c.

◆ tls_cache_lock()

static void tls_cache_lock ( tls_conf_global_t gconf)
static

Definition at line 197 of file tls_cache.c.

◆ tls_cache_post_config()

apr_status_t tls_cache_post_config ( apr_pool_t p,
apr_pool_t ptemp,
server_rec s 
)

Verify the cache settings at the end of the configuration and create the default session cache, if not already done.

Definition at line 137 of file tls_cache.c.

◆ tls_cache_pre_config()

void tls_cache_pre_config ( apr_pool_t pconf,
apr_pool_t plog,
apr_pool_t ptemp 
)

Setup before configuration runs, announces our potential global mutex.

Definition at line 55 of file tls_cache.c.

◆ tls_cache_put()

static rustls_result tls_cache_put ( void *  userdata,
const rustls_slice_bytes key,
const rustls_slice_bytes val 
)
static

Definition at line 264 of file tls_cache.c.

◆ tls_cache_set_specification()

const char * tls_cache_set_specification ( const char spec,
tls_conf_global_t gconf,
apr_pool_t p,
apr_pool_t ptemp 
)

Set the specification of the session cache to use. The syntax is "default|none|<provider_name>(:<arguments>)?"

Parameters
specthe cache specification
gconfthe modules global configuration
ppool for permanent allocations
ptemppool for temporary allocations
Returns
NULL on success or an error message

Definition at line 130 of file tls_cache.c.

◆ tls_cache_unlock()

static void tls_cache_unlock ( tls_conf_global_t gconf)
static

Definition at line 208 of file tls_cache.c.

Variable Documentation

◆ aplog_module_index

int* const aplog_module_index = &( tls_module.module_index)
static

Definition at line 34 of file tls_cache.c.