diff options
author | Nokis Mavrogiannopoulos | 2008-03-03 14:04:01 +0000 |
---|---|---|
committer | Nokis Mavrogiannopoulos | 2008-03-03 14:04:01 +0000 |
commit | 9b5f7b906208c1ccc7469aae6aada611ca010e07 (patch) | |
tree | 6a32b9c486e92bd3cbaefea3f248ef325e972177 | |
parent | 4149b4f93e99e5134c1599cc1c2fb4a0603e2007 (diff) |
corrected SRP enable flag, and corrected the DBM hook support. It now free data needed by some DBM providers.
-rwxr-xr-x | autogen.sh | 17 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | src/gnutls_cache.c | 9 | ||||
-rw-r--r-- | src/mod_gnutls.c | 1 |
4 files changed, 14 insertions, 20 deletions
@@ -1,25 +1,10 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | if [ -z $ACLOCAL ]; then | ||
4 | ACLOCAL=aclocal | ||
5 | fi | ||
6 | if [ -z $AUTOCONF ]; then | ||
7 | AUTOCONF=autoconf | ||
8 | fi | ||
9 | if [ -z $AUTOHEADER ]; then | ||
10 | AUTOHEADER=autoheader | ||
11 | fi | ||
12 | if [ -z $AUTORECONF ]; then | 3 | if [ -z $AUTORECONF ]; then |
13 | AUTORECONF=autoreconf | 4 | AUTORECONF=autoreconf |
14 | fi | 5 | fi |
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 | ||
20 | for 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 | ||
25 | 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, | |||
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 | |||
45 | SRP_CFLAGS="" | ||
44 | if test "$use_srp" != "no"; then | 46 | if test "$use_srp" != "no"; then |
45 | AC_DEFINE_UNQUOTED(ENABLE_SRP, 1, [whether to enable SRP]) | 47 | SRP_CFLAGS="-DENABLE_SRP=1" |
46 | fi | 48 | fi |
47 | AC_MSG_CHECKING([whether to enable SRP functionality]) | 49 | AC_MSG_CHECKING([whether to enable SRP functionality]) |
48 | AC_MSG_RESULT($use_srp) | 50 | AC_MSG_RESULT($use_srp) |
@@ -53,7 +55,7 @@ have_apr_memcache=0 | |||
53 | CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0]) | 55 | CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0]) |
54 | AC_SUBST(have_apr_memcache) | 56 | AC_SUBST(have_apr_memcache) |
55 | 57 | ||
56 | MODULE_CFLAGS="${LIBGNUTLS_EXTRA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" | 58 | MODULE_CFLAGS="${LIBGNUTLS_EXTRA_CFLAGS} ${SRP_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" |
57 | MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_EXTRA_LIBS}" | 59 | MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_EXTRA_LIBS}" |
58 | 60 | ||
59 | AC_SUBST(MODULE_CFLAGS) | 61 | AC_SUBST(MODULE_CFLAGS) |
@@ -68,5 +70,6 @@ echo "" | |||
68 | echo " * mod_gnutls version: ${MOD_GNUTLS_VERSION}" | 70 | echo " * mod_gnutls version: ${MOD_GNUTLS_VERSION}" |
69 | echo " * Apache Modules directory: ${AP_LIBEXECDIR}" | 71 | echo " * Apache Modules directory: ${AP_LIBEXECDIR}" |
70 | echo " * GnuTLS Library version: ${LIBGNUTLS_VERSION}" | 72 | echo " * GnuTLS Library version: ${LIBGNUTLS_VERSION}" |
73 | echo " * SRP Authentication: ${use_srp}" | ||
71 | echo "" | 74 | echo "" |
72 | echo "---" | 75 | 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 @@ | |||
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 | |||
21 | static void gnutls_hooks(apr_pool_t * p) | 20 | static 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, |