aboutsummaryrefslogtreecommitdiffstats
path: root/src/gnutls_hooks.c
diff options
context:
space:
mode:
authorGravatar Nikos Mavrogiannopoulos 2007-12-08 16:07:12 +0000
committerGravatar Nokis Mavrogiannopoulos 2007-12-08 16:07:12 +0000
commit5e81262428771649043a728ac813370aaa47a46b (patch)
tree9225c0da012618b8d88d2562c9ee8024a523765e /src/gnutls_hooks.c
parent3b83e00f867a2264aa6742ebca86c4c450d6939c (diff)
Added support for sending more than one certificate.
Diffstat (limited to 'src/gnutls_hooks.c')
-rw-r--r--src/gnutls_hooks.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gnutls_hooks.c b/src/gnutls_hooks.c
index 4364add..025e4e1 100644
--- a/src/gnutls_hooks.c
+++ b/src/gnutls_hooks.c
@@ -148,10 +148,10 @@ static int cert_retrieve_fn(gnutls_session_t session, gnutls_retr_st * ret)
148 ctxt = gnutls_transport_get_ptr(session); 148 ctxt = gnutls_transport_get_ptr(session);
149 149
150 ret->type = GNUTLS_CRT_X509; 150 ret->type = GNUTLS_CRT_X509;
151 ret->ncerts = 1; 151 ret->ncerts = ctxt->sc->certs_x509_num;
152 ret->deinit_all = 0; 152 ret->deinit_all = 0;
153 153
154 ret->cert.x509 = &ctxt->sc->cert_x509; 154 ret->cert.x509 = ctxt->sc->certs_x509;
155 ret->key.x509 = ctxt->sc->privkey_x509; 155 ret->key.x509 = ctxt->sc->privkey_x509;
156 return 0; 156 return 0;
157} 157}
@@ -334,7 +334,7 @@ mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog,
334 } 334 }
335 } 335 }
336 336
337 if (sc->cert_x509 == NULL 337 if (sc->certs_x509[0] == NULL
338 && sc->enabled == GNUTLS_ENABLED_TRUE) { 338 && sc->enabled == GNUTLS_ENABLED_TRUE) {
339 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, 339 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s,
340 "[GnuTLS] - Host '%s:%d' is missing a " 340 "[GnuTLS] - Host '%s:%d' is missing a "
@@ -353,7 +353,7 @@ mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog,
353 } 353 }
354 354
355 if (sc->enabled == GNUTLS_ENABLED_TRUE) { 355 if (sc->enabled == GNUTLS_ENABLED_TRUE) {
356 rv = read_crt_cn(s, p, sc->cert_x509, &sc->cert_cn); 356 rv = read_crt_cn(s, p, sc->certs_x509[0], &sc->cert_cn);
357 if (rv < 0) { 357 if (rv < 0) {
358 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, 358 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s,
359 "[GnuTLS] - Cannot find a certificate for host '%s:%d'!", 359 "[GnuTLS] - Cannot find a certificate for host '%s:%d'!",
@@ -686,7 +686,7 @@ int mgs_hook_fixups(request_rec * r)
686 tmp = mgs_session_id2sz(sbuf, len, buf, sizeof(buf)); 686 tmp = mgs_session_id2sz(sbuf, len, buf, sizeof(buf));
687 apr_table_setn(env, "SSL_SESSION_ID", apr_pstrdup(r->pool, tmp)); 687 apr_table_setn(env, "SSL_SESSION_ID", apr_pstrdup(r->pool, tmp));
688 688
689 mgs_add_common_cert_vars(r, ctxt->sc->cert_x509, 0, 689 mgs_add_common_cert_vars(r, ctxt->sc->certs_x509[0], 0,
690 ctxt->sc->export_certificates_enabled); 690 ctxt->sc->export_certificates_enabled);
691 691
692 return rv; 692 return rv;