Commit 22ac5add authored by Doug MacEachern's avatar Doug MacEachern
Browse files

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
parent 27c4f2aa
Loading
Loading
Loading
Loading
+2 −0
Changes for mod_ssl.h: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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);
+12 −5
Changes for ssl_util.c: 12 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -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