diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2007-03-21 02:55:29 +0100 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2007-03-21 02:55:29 +0100 |
commit | 95f79e87b601c4eb7b692508edb0db02932bb77e (patch) | |
tree | 747361facdeade638bb180502c9cc9db1858dad3 /modules/ssl/ssl_engine_vars.c | |
parent | Even though we don't let our bb grow too large, still (diff) | |
download | apache2-95f79e87b601c4eb7b692508edb0db02932bb77e.tar.xz apache2-95f79e87b601c4eb7b692508edb0db02932bb77e.zip |
*) adds compile-time/run time SSL-C version support
*) simplify a ton of overly-verbose legacy code
*) split the compiled-against v.s. runtime library
*) precache the results of the version string touchup
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@520701 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/ssl/ssl_engine_vars.c')
-rw-r--r-- | modules/ssl/ssl_engine_vars.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/modules/ssl/ssl_engine_vars.c b/modules/ssl/ssl_engine_vars.c index 9617f6d6b2..773918c3ed 100644 --- a/modules/ssl/ssl_engine_vars.c +++ b/modules/ssl/ssl_engine_vars.c @@ -635,31 +635,41 @@ static void ssl_var_lookup_ssl_cipher_bits(SSL *ssl, int *usekeysize, int *algke static char *ssl_var_lookup_ssl_version(apr_pool_t *p, char *var) { + static char interface[] = "mod_ssl/" MOD_SSL_VERSION; + static char library_interface[] = SSL_LIBRARY_TEXT; + static char *library = NULL; char *result; - char *cp, *cp2; - - result = NULL; - - if (strEQ(var, "PRODUCT")) { -#if defined(SSL_PRODUCT_NAME) && defined(SSL_PRODUCT_VERSION) - result = apr_psprintf(p, "%s/%s", SSL_PRODUCT_NAME, SSL_PRODUCT_VERSION); -#else - result = NULL; -#endif - } - else if (strEQ(var, "INTERFACE")) { - result = apr_psprintf(p, "mod_ssl/%s", MOD_SSL_VERSION); - } - else if (strEQ(var, "LIBRARY")) { - result = apr_pstrdup(p, SSLeay_version(SSLEAY_VERSION)); - if ((cp = strchr(result, ' ')) != NULL) { + + if (!library) { + char *cp, *cp2; + library = apr_pstrdup(p, SSL_LIBRARY_DYNTEXT); + if ((cp = strchr(library, ' ')) != NULL) { *cp = '/'; if ((cp2 = strchr(cp, ' ')) != NULL) *cp2 = NUL; } + if ((cp = strchr(library_interface, ' ')) != NULL) { + *cp = '/'; + if ((cp2 = strchr(cp, ' ')) != NULL) + *cp2 = NUL; + } + } + + if (strEQ(var, "INTERFACE")) { + result = apr_pstrdup(p, interface); + } + else if (strEQ(var, "LIBRARY_INTERFACE")) { + result = apr_pstrdup(p, library_interface); + } + else if (strEQ(var, "LIBRARY")) { + result = apr_pstrdup(p, library); + } + else { + result = NULL; } return result; } + apr_array_header_t *ssl_ext_list(apr_pool_t *p, conn_rec *c, int peer, const char *extension) |