aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--include/mod_gnutls.h1
-rw-r--r--src/mod_gnutls.c26
3 files changed, 24 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 483540f..1a72b8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,10 +22,10 @@ CHECK_APACHE(,$AP_VERSION,
22MIN_TLS_VERSION=1.1.0 22MIN_TLS_VERSION=1.1.0
23CHECK_LIBGNUTLS($MIN_TLS_VERSION) 23CHECK_LIBGNUTLS($MIN_TLS_VERSION)
24 24
25CHECK_MEMCACHE 25CHECK_APR_MEMCACHE()
26 26
27MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" 27MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}"
28MODULE_LIBS="${LIBGNUTLS_LIBS} ${LIBMEMCACHE_LIBS}" 28MODULE_LIBS="${LIBGNUTLS_LIBS} ${APR_MEMCACHE_LIBS}"
29 29
30AC_SUBST(MODULE_CFLAGS) 30AC_SUBST(MODULE_CFLAGS)
31AC_SUBST(MODULE_LIBS) 31AC_SUBST(MODULE_LIBS)
diff --git a/include/mod_gnutls.h b/include/mod_gnutls.h
index 3ea9b58..0f3433c 100644
--- a/include/mod_gnutls.h
+++ b/include/mod_gnutls.h
@@ -22,6 +22,7 @@
22#include "http_config.h" 22#include "http_config.h"
23#include "http_protocol.h" 23#include "http_protocol.h"
24#include "http_connection.h" 24#include "http_connection.h"
25#include "http_request.h"
25#include "http_core.h" 26#include "http_core.h"
26#include "http_log.h" 27#include "http_log.h"
27#include "apr_buckets.h" 28#include "apr_buckets.h"
diff --git a/src/mod_gnutls.c b/src/mod_gnutls.c
index 04f7db9..3dfbd9a 100644
--- a/src/mod_gnutls.c
+++ b/src/mod_gnutls.c
@@ -52,19 +52,34 @@ static int mod_gnutls_hook_post_config(apr_pool_t * p, apr_pool_t * plog,
52 server_rec * base_server) 52 server_rec * base_server)
53{ 53{
54 mod_gnutls_srvconf_rec *sc; 54 mod_gnutls_srvconf_rec *sc;
55 void *data = NULL;
56 int first_run = 0;
55 server_rec *s; 57 server_rec *s;
56 gnutls_dh_params_t dh_params; 58 gnutls_dh_params_t dh_params;
57#ifdef USE_RSA 59#ifdef USE_RSA
58 gnutls_rsa_params_t rsa_params; 60 gnutls_rsa_params_t rsa_params;
59#endif 61#endif
62 const char *userdata_key = "mod_gnutls_init";
63
64 apr_pool_userdata_get(&data, userdata_key, base_server->process->pool);
65 if (data == NULL) {
66 first_run = 1;
67 apr_pool_userdata_set((const void *)1, userdata_key,
68 apr_pool_cleanup_null,
69 base_server->process->pool);
70 }
71
60 72
61 /* TODO: Should we regenerate these after X requests / X time ? */ 73 if(first_run) {
62 gnutls_dh_params_init(&dh_params); 74 /* TODO: Should we regenerate these after X requests / X time ? */
63 gnutls_dh_params_generate2(dh_params, DH_BITS); 75 gnutls_dh_params_init(&dh_params);
76 gnutls_dh_params_generate2(dh_params, DH_BITS);
64#ifdef USE_RSA 77#ifdef USE_RSA
65 gnutls_rsa_params_init(&rsa_params); 78 gnutls_rsa_params_init(&rsa_params);
66 gnutls_rsa_params_generate2(rsa_params, RSA_BITS); 79 gnutls_rsa_params_generate2(rsa_params, RSA_BITS);
67#endif 80#endif
81 }
82
68 for (s = base_server; s; s = s->next) { 83 for (s = base_server; s; s = s->next) {
69 sc = (mod_gnutls_srvconf_rec *) ap_get_module_config(s->module_config, 84 sc = (mod_gnutls_srvconf_rec *) ap_get_module_config(s->module_config,
70 &gnutls_module); 85 &gnutls_module);
@@ -86,6 +101,7 @@ static int mod_gnutls_hook_post_config(apr_pool_t * p, apr_pool_t * plog,
86 101
87 102
88 ap_add_version_component(p, "GnuTLS/" LIBGNUTLS_VERSION); 103 ap_add_version_component(p, "GnuTLS/" LIBGNUTLS_VERSION);
104
89 return OK; 105 return OK;
90} 106}
91 107