From f85127773a985a717e05aa95f8518fc647329010 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 8 Mar 2002 18:16:41 +0000 Subject: [PATCH] support reuse of encrypted DSA keys on restart git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93799 13f79535-47bb-0310-9956-ffa450edef68 --- modules/ssl/ssl_engine_pphrase.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/modules/ssl/ssl_engine_pphrase.c b/modules/ssl/ssl_engine_pphrase.c index f1d6b7b175..1e6f626b29 100644 --- a/modules/ssl/ssl_engine_pphrase.c +++ b/modules/ssl/ssl_engine_pphrase.c @@ -319,14 +319,22 @@ void ssl_pphrase_Handle(server_rec *s, apr_pool_t *p) * are used to give a better idea as to what failed. */ if (pkey_mtime) { - char *key_id = apr_psprintf(p, "%s:%s", cpVHostID, "RSA"); /* XXX: check for DSA key too? */ - ssl_asn1_t *asn1 = ssl_asn1_table_get(mc->tPrivateKey, key_id); + const char *key_types[] = {"RSA", "DSA", NULL}; + int i; + + for (i=0; key_types[i]; i++) { + char *key_id = + apr_psprintf(p, "%s:%s", cpVHostID, key_types[i]); + ssl_asn1_t *asn1 = + ssl_asn1_table_get(mc->tPrivateKey, key_id); - if (asn1 && (asn1->source_mtime == pkey_mtime)) { - ssl_log(pServ, SSL_LOG_INFO, - "%s reusing existing private key on restart", - cpVHostID); - return; + if (asn1 && (asn1->source_mtime == pkey_mtime)) { + ssl_log(pServ, SSL_LOG_INFO, + "%s reusing existing " + "%s private key on restart", + cpVHostID, key_types[i]); + return; + } } } -- 2.40.0