aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xautogen.sh17
-rw-r--r--configure.ac7
-rw-r--r--src/gnutls_cache.c9
-rw-r--r--src/mod_gnutls.c1
4 files changed, 14 insertions, 20 deletions
diff --git a/autogen.sh b/autogen.sh
index 742b2cc..541e187 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,25 +1,10 @@
1#!/bin/sh 1#!/bin/sh
2 2
3if [ -z $ACLOCAL ]; then
4 ACLOCAL=aclocal
5fi
6if [ -z $AUTOCONF ]; then
7 AUTOCONF=autoconf
8fi
9if [ -z $AUTOHEADER ]; then
10 AUTOHEADER=autoheader
11fi
12if [ -z $AUTORECONF ]; then 3if [ -z $AUTORECONF ]; then
13 AUTORECONF=autoreconf 4 AUTORECONF=autoreconf
14fi 5fi
15 6
16#rm -rf autom4te.cache 7#rm -rf autom4te.cache
17$AUTORECONF -f -i 8$AUTORECONF -f -v -i
18#touch stamp-h.in 9#touch stamp-h.in
19 10
20for x in providers/*; do
21 if [ -e $x/autogen.sh ]; then
22 echo Generating Config files in $x
23 (cd $x; ./autogen.sh $*)
24 fi
25done
diff --git a/configure.ac b/configure.ac
index 28001b3..62db2af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,8 +41,10 @@ AC_ARG_ENABLE(srp,
41 AS_HELP_STRING([--disable-srp], 41 AS_HELP_STRING([--disable-srp],
42 [unconditionally disable the SRP functionality]), 42 [unconditionally disable the SRP functionality]),
43 use_srp=$enableval, use_srp=yes) 43 use_srp=$enableval, use_srp=yes)
44
45SRP_CFLAGS=""
44if test "$use_srp" != "no"; then 46if test "$use_srp" != "no"; then
45 AC_DEFINE_UNQUOTED(ENABLE_SRP, 1, [whether to enable SRP]) 47 SRP_CFLAGS="-DENABLE_SRP=1"
46fi 48fi
47AC_MSG_CHECKING([whether to enable SRP functionality]) 49AC_MSG_CHECKING([whether to enable SRP functionality])
48AC_MSG_RESULT($use_srp) 50AC_MSG_RESULT($use_srp)
@@ -53,7 +55,7 @@ have_apr_memcache=0
53CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0]) 55CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0])
54AC_SUBST(have_apr_memcache) 56AC_SUBST(have_apr_memcache)
55 57
56MODULE_CFLAGS="${LIBGNUTLS_EXTRA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" 58MODULE_CFLAGS="${LIBGNUTLS_EXTRA_CFLAGS} ${SRP_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}"
57MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_EXTRA_LIBS}" 59MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_EXTRA_LIBS}"
58 60
59AC_SUBST(MODULE_CFLAGS) 61AC_SUBST(MODULE_CFLAGS)
@@ -68,5 +70,6 @@ echo ""
68echo " * mod_gnutls version: ${MOD_GNUTLS_VERSION}" 70echo " * mod_gnutls version: ${MOD_GNUTLS_VERSION}"
69echo " * Apache Modules directory: ${AP_LIBEXECDIR}" 71echo " * Apache Modules directory: ${AP_LIBEXECDIR}"
70echo " * GnuTLS Library version: ${LIBGNUTLS_VERSION}" 72echo " * GnuTLS Library version: ${LIBGNUTLS_VERSION}"
73echo " * SRP Authentication: ${use_srp}"
71echo "" 74echo ""
72echo "---" 75echo "---"
diff --git a/src/gnutls_cache.c b/src/gnutls_cache.c
index 83e7bb5..90f5a86 100644
--- a/src/gnutls_cache.c
+++ b/src/gnutls_cache.c
@@ -1,5 +1,6 @@
1/** 1/**
2 * Copyright 2004-2005 Paul Querna 2 * Copyright 2004-2005 Paul Querna
3 * Portions Copyright 2008 Nikos Mavrogiannopoulos
3 * 4 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 6 * you may not use this file except in compliance with the License.
@@ -345,6 +346,7 @@ static int dbm_cache_expire(mgs_handle_t *ctxt)
345 break; 346 break;
346 } 347 }
347 } 348 }
349 apr_dbm_freedatum( dbm, dbmval);
348 350
349 } 351 }
350 apr_dbm_nextkey(dbm, &dbmkey); 352 apr_dbm_nextkey(dbm, &dbmkey);
@@ -401,20 +403,25 @@ static gnutls_datum_t dbm_cache_fetch(void* baton, gnutls_datum_t key)
401 } 403 }
402 404
403 if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) { 405 if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) {
406 apr_dbm_freedatum( dbm, dbmval);
404 apr_dbm_close(dbm); 407 apr_dbm_close(dbm);
405 return data; 408 return data;
406 } 409 }
407 apr_dbm_close(dbm);
408 410
409 data.size = dbmval.dsize - sizeof(apr_time_t); 411 data.size = dbmval.dsize - sizeof(apr_time_t);
410 412
411 data.data = gnutls_malloc(data.size); 413 data.data = gnutls_malloc(data.size);
412 if (data.data == NULL) { 414 if (data.data == NULL) {
415 apr_dbm_freedatum( dbm, dbmval);
416 apr_dbm_close(dbm);
413 return data; 417 return data;
414 } 418 }
415 419
416 memcpy(data.data, dbmval.dptr+sizeof(apr_time_t), data.size); 420 memcpy(data.data, dbmval.dptr+sizeof(apr_time_t), data.size);
417 421
422 apr_dbm_freedatum( dbm, dbmval);
423 apr_dbm_close(dbm);
424
418 return data; 425 return data;
419} 426}
420 427
diff --git a/src/mod_gnutls.c b/src/mod_gnutls.c
index 5207641..08e7dba 100644
--- a/src/mod_gnutls.c
+++ b/src/mod_gnutls.c
@@ -17,7 +17,6 @@
17 17
18#include "mod_gnutls.h" 18#include "mod_gnutls.h"
19 19
20
21static void gnutls_hooks(apr_pool_t * p) 20static void gnutls_hooks(apr_pool_t * p)
22{ 21{
23 ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL, 22 ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL,