From: Doug MacEachern Date: Wed, 13 Mar 2002 18:56:07 +0000 (+0000) Subject: add ssl_asn1_keystr() util function that returns string representation X-Git-Tag: CHANGES~71 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07965e685f02c02253581be1339f5adff2fa4133;p=apache add ssl_asn1_keystr() util function that returns string representation (RSA or DSA) of the key index. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93912 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ssl/mod_ssl.h b/modules/ssl/mod_ssl.h index 39a7261973..3e372191a9 100644 --- a/modules/ssl/mod_ssl.h +++ b/modules/ssl/mod_ssl.h @@ -713,6 +713,8 @@ 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_keystr(int keytype); + const char *ssl_asn1_table_keyfmt(apr_pool_t *p, const char *id, int keytype); diff --git a/modules/ssl/ssl_util.c b/modules/ssl/ssl_util.c index 4555f934e2..1fa18ae27c 100644 --- a/modules/ssl/ssl_util.c +++ b/modules/ssl/ssl_util.c @@ -375,18 +375,25 @@ void ssl_asn1_table_unset(apr_hash_t *table, static const char *ssl_asn1_key_types[] = {"RSA", "DSA"}; -const char *ssl_asn1_table_keyfmt(apr_pool_t *p, - const char *id, - int keytype) +const char *ssl_asn1_keystr(int keytype) { if (keytype >= SSL_AIDX_MAX) { return NULL; } - return apr_pstrcat(p, id, ":", - ssl_asn1_key_types[keytype], NULL); + return ssl_asn1_key_types[keytype]; } +const char *ssl_asn1_table_keyfmt(apr_pool_t *p, + const char *id, + int keytype) +{ + const char *keystr = ssl_asn1_keystr(keytype); + + return apr_pstrcat(p, id, ":", keystr, NULL); +} + + #if APR_HAS_THREADS /* * To ensure thread-safetyness in OpenSSL - work in progress