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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22ac5addfae94d6b5ab04e0970d126d26ff43621;p=thirdparty%2Fapache%2Fhttpd.git 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/modules/ssl@93912 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/mod_ssl.h b/mod_ssl.h index 39a7261973e..3e372191a90 100644 --- a/mod_ssl.h +++ b/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/ssl_util.c b/ssl_util.c index 4555f934e29..1fa18ae27cf 100644 --- a/ssl_util.c +++ b/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