diff options
author | Nikos Mavrogiannopoulos | 2010-07-01 03:09:56 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos | 2010-07-01 03:09:56 +0200 |
commit | 36c02797b672ed5ed937c798bd97aeeb7394f038 (patch) | |
tree | 681d5b28d283c5ea2d8248d16d5ce23dc27df165 /src | |
parent | 47e0ccc66d3ed9112140ae9ec75394d7fa4bf5e1 (diff) |
Added option to turn on/off session tickets.
Diffstat (limited to 'src')
-rw-r--r-- | src/gnutls_config.c | 16 | ||||
-rw-r--r-- | src/gnutls_hooks.c | 2 | ||||
-rw-r--r-- | src/mod_gnutls.c | 4 |
3 files changed, 21 insertions, 1 deletions
diff --git a/src/gnutls_config.c b/src/gnutls_config.c index d75e785..ca26a2d 100644 --- a/src/gnutls_config.c +++ b/src/gnutls_config.c | |||
@@ -285,6 +285,22 @@ const char *mgs_set_pgpkey_file(cmd_parms * parms, void *dummy, | |||
285 | return NULL; | 285 | return NULL; |
286 | } | 286 | } |
287 | 287 | ||
288 | const char *mgs_set_tickets(cmd_parms * parms, void *dummy, | ||
289 | const char *arg) | ||
290 | { | ||
291 | mgs_srvconf_rec *sc = | ||
292 | (mgs_srvconf_rec *) ap_get_module_config(parms->server-> | ||
293 | module_config, | ||
294 | &gnutls_module); | ||
295 | |||
296 | sc->tickets = 0; | ||
297 | if (strcasecmp("on", arg) == 0) { | ||
298 | sc->tickets = 1; | ||
299 | } | ||
300 | |||
301 | return NULL; | ||
302 | } | ||
303 | |||
288 | 304 | ||
289 | #ifdef ENABLE_SRP | 305 | #ifdef ENABLE_SRP |
290 | 306 | ||
diff --git a/src/gnutls_hooks.c b/src/gnutls_hooks.c index 2130cb0..032e6f3 100644 --- a/src/gnutls_hooks.c +++ b/src/gnutls_hooks.c | |||
@@ -673,7 +673,7 @@ static mgs_handle_t *create_gnutls_handle(apr_pool_t * pool, conn_rec * c) | |||
673 | ctxt->output_length = 0; | 673 | ctxt->output_length = 0; |
674 | 674 | ||
675 | gnutls_init(&ctxt->session, GNUTLS_SERVER); | 675 | gnutls_init(&ctxt->session, GNUTLS_SERVER); |
676 | if (session_ticket_key.data != NULL) | 676 | if (session_ticket_key.data != NULL && ctxt->sc->tickets != 0) |
677 | gnutls_session_ticket_enable_server(ctxt->session, &session_ticket_key); | 677 | gnutls_session_ticket_enable_server(ctxt->session, &session_ticket_key); |
678 | 678 | ||
679 | /* because we don't set any default priorities here (we set later at | 679 | /* because we don't set any default priorities here (we set later at |
diff --git a/src/mod_gnutls.c b/src/mod_gnutls.c index 08e7dba..c95d183 100644 --- a/src/mod_gnutls.c +++ b/src/mod_gnutls.c | |||
@@ -121,6 +121,10 @@ static const command_rec mgs_config_cmds[] = { | |||
121 | NULL, | 121 | NULL, |
122 | RSRC_CONF, | 122 | RSRC_CONF, |
123 | "Cache Configuration"), | 123 | "Cache Configuration"), |
124 | AP_INIT_TAKE1("GnuTLSSessionTickets", mgs_set_tickets, | ||
125 | NULL, | ||
126 | RSRC_CONF, | ||
127 | "Session Tickets Configuration"), | ||
124 | AP_INIT_RAW_ARGS("GnuTLSPriorities", mgs_set_priorities, | 128 | AP_INIT_RAW_ARGS("GnuTLSPriorities", mgs_set_priorities, |
125 | NULL, | 129 | NULL, |
126 | RSRC_CONF, | 130 | RSRC_CONF, |