From: Doug MacEachern Date: Fri, 8 Mar 2002 18:16:41 +0000 (+0000) Subject: support reuse of encrypted DSA keys on restart X-Git-Tag: CHANGES~171 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf13aec945b2031e4c444ab7c6b7735e0171ba7f;p=apache 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 --- 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; + } } }