From 9b5f7b906208c1ccc7469aae6aada611ca010e07 Mon Sep 17 00:00:00 2001 From: Nokis Mavrogiannopoulos Date: Mon, 3 Mar 2008 14:04:01 +0000 Subject: corrected SRP enable flag, and corrected the DBM hook support. It now free data needed by some DBM providers. --- autogen.sh | 17 +---------------- configure.ac | 7 +++++-- src/gnutls_cache.c | 9 ++++++++- src/mod_gnutls.c | 1 - 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 @@ #!/bin/sh -if [ -z $ACLOCAL ]; then - ACLOCAL=aclocal -fi -if [ -z $AUTOCONF ]; then - AUTOCONF=autoconf -fi -if [ -z $AUTOHEADER ]; then - AUTOHEADER=autoheader -fi if [ -z $AUTORECONF ]; then AUTORECONF=autoreconf fi #rm -rf autom4te.cache -$AUTORECONF -f -i +$AUTORECONF -f -v -i #touch stamp-h.in -for x in providers/*; do - if [ -e $x/autogen.sh ]; then - echo Generating Config files in $x - (cd $x; ./autogen.sh $*) - fi -done 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, AS_HELP_STRING([--disable-srp], [unconditionally disable the SRP functionality]), use_srp=$enableval, use_srp=yes) + +SRP_CFLAGS="" if test "$use_srp" != "no"; then - AC_DEFINE_UNQUOTED(ENABLE_SRP, 1, [whether to enable SRP]) + SRP_CFLAGS="-DENABLE_SRP=1" fi AC_MSG_CHECKING([whether to enable SRP functionality]) AC_MSG_RESULT($use_srp) @@ -53,7 +55,7 @@ have_apr_memcache=0 CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0]) AC_SUBST(have_apr_memcache) -MODULE_CFLAGS="${LIBGNUTLS_EXTRA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" +MODULE_CFLAGS="${LIBGNUTLS_EXTRA_CFLAGS} ${SRP_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_EXTRA_LIBS}" AC_SUBST(MODULE_CFLAGS) @@ -68,5 +70,6 @@ echo "" echo " * mod_gnutls version: ${MOD_GNUTLS_VERSION}" echo " * Apache Modules directory: ${AP_LIBEXECDIR}" echo " * GnuTLS Library version: ${LIBGNUTLS_VERSION}" +echo " * SRP Authentication: ${use_srp}" echo "" echo "---" 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 @@ /** * Copyright 2004-2005 Paul Querna + * Portions Copyright 2008 Nikos Mavrogiannopoulos * * Licensed under the Apache License, Version 2.0 (the "License"); * 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) break; } } + apr_dbm_freedatum( dbm, dbmval); } apr_dbm_nextkey(dbm, &dbmkey); @@ -401,20 +403,25 @@ static gnutls_datum_t dbm_cache_fetch(void* baton, gnutls_datum_t key) } if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) { + apr_dbm_freedatum( dbm, dbmval); apr_dbm_close(dbm); return data; } - apr_dbm_close(dbm); data.size = dbmval.dsize - sizeof(apr_time_t); data.data = gnutls_malloc(data.size); if (data.data == NULL) { + apr_dbm_freedatum( dbm, dbmval); + apr_dbm_close(dbm); return data; } memcpy(data.data, dbmval.dptr+sizeof(apr_time_t), data.size); + apr_dbm_freedatum( dbm, dbmval); + apr_dbm_close(dbm); + return data; } 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 @@ #include "mod_gnutls.h" - static void gnutls_hooks(apr_pool_t * p) { ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL, -- cgit