From 23491e9b7888bd5e670ee7ab21c5c3c549e1ff65 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 13 Mar 2002 18:42:05 +0000 Subject: [PATCH] add ssl_asn1_table_keyfmt() function for clarity git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93909 13f79535-47bb-0310-9956-ffa450edef68 --- modules/ssl/mod_ssl.h | 3 +++ modules/ssl/ssl_util.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/modules/ssl/mod_ssl.h b/modules/ssl/mod_ssl.h index fa45872859..39a7261973 100644 --- a/modules/ssl/mod_ssl.h +++ b/modules/ssl/mod_ssl.h @@ -713,6 +713,9 @@ ssl_asn1_t *ssl_asn1_table_get(apr_hash_t *table, void ssl_asn1_table_unset(apr_hash_t *table, const char *key); +const char *ssl_asn1_table_keyfmt(apr_pool_t *p, + const char *id, + int keytype); /* Mutex Support */ int ssl_mutex_init(server_rec *, apr_pool_t *); int ssl_mutex_reinit(server_rec *, apr_pool_t *); diff --git a/modules/ssl/ssl_util.c b/modules/ssl/ssl_util.c index 53484e5d83..4555f934e2 100644 --- a/modules/ssl/ssl_util.c +++ b/modules/ssl/ssl_util.c @@ -373,6 +373,20 @@ void ssl_asn1_table_unset(apr_hash_t *table, apr_hash_set(table, key, klen, NULL); } +static const char *ssl_asn1_key_types[] = {"RSA", "DSA"}; + +const char *ssl_asn1_table_keyfmt(apr_pool_t *p, + const char *id, + int keytype) +{ + if (keytype >= SSL_AIDX_MAX) { + return NULL; + } + + return apr_pstrcat(p, id, ":", + ssl_asn1_key_types[keytype], NULL); +} + #if APR_HAS_THREADS /* * To ensure thread-safetyness in OpenSSL - work in progress -- 2.50.1