]> granicus.if.org Git - apache/commitdiff
add ssl_asn1_table_keyfmt() function for clarity
authorDoug MacEachern <dougm@apache.org>
Wed, 13 Mar 2002 18:42:05 +0000 (18:42 +0000)
committerDoug MacEachern <dougm@apache.org>
Wed, 13 Mar 2002 18:42:05 +0000 (18:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93909 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/mod_ssl.h
modules/ssl/ssl_util.c

index fa4587285956b595832a4919a17c784ab44ec0e2..39a7261973e120608f74c62cfa46e2c2ddd6c5b8 100644 (file)
@@ -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 *);
index 53484e5d83baa5f165237bf0be8c47a7cf20428c..4555f934e298fa8973348a65b787f4a82d260337 100644 (file)
@@ -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