mod_session_crypto.c revision 7d9413bb133b6bbd3ff03f21d1e6fb5cc9b0c050
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley/* Licensed to the Apache Software Foundation (ASF) under one or more
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * contributor license agreements. See the NOTICE file distributed with
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * this work for additional information regarding copyright ownership.
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * The ASF licenses this file to You under the Apache License, Version 2.0
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * (the "License"); you may not use this file except in compliance with
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * the License. You may obtain a copy of the License at
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * Unless required by applicable law or agreed to in writing, software
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * distributed under the License is distributed on an "AS IS" BASIS,
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * See the License for the specific language governing permissions and
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * limitations under the License.
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff#include "apr_base64.h" /* for apr_base64_decode et al */
1ca02d14e46beb40bdc4720d5d7e49dcfd718754James Brister#if APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION < 4
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff#error session_crypto_module requires APU v1.4.0 or later
b6026c656d89e9c6d578949fa97d422285445f13James Brister#include "apr_crypto.h" /* for apr_*_crypt et al */
6d5dcd0dc9bdbd679282b1ffc47987d24c3a1346Bob Halleymodule AP_MODULE_DECLARE_DATA session_crypto_module;
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Graff * Structure to carry the per-dir session config.
1840745dd553b2ff5b114a03cde40a2a404aa559Michael Grafftypedef struct {
b6026c656d89e9c6d578949fa97d422285445f13James Brister * Structure to carry the server wide session config.
b6026c656d89e9c6d578949fa97d422285445f13James Bristertypedef struct {
int noinit_set;
if (!driver) {
return APR_EGENERAL;
return APR_EGENERAL;
return APR_EGENERAL;
return APR_SUCCESS;
char *base64;
return APR_SUCCESS;
return res;
&blockSize);
return res;
return res;
&tlen);
return res;
return res;
char *decoded;
return res;
return APR_ECRYPT;
&blockSize);
f, r->pool);
return res;
if (res) {
return res;
&tlen);
return res;
return APR_SUCCESS;
return res;
return OK;
return res;
return OK;
return OK;
return rv;
return rv;
return rv;
return rv;
return OK;
return (void *) new;
return (void *) new;
session_crypto_dir_conf *new = (session_crypto_dir_conf *) apr_pcalloc(p, sizeof(session_crypto_dir_conf));
return new;
int library_set = 0;
return err;
while (*arg) {
if (!val) {
else if (!library_set) {
return NULL;
int passphrase_set = 0;
while (*arg) {
if (!val) {
if (!passphrase_set) {
return NULL;
{ NULL}