]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport applied
authorJim Jagielski <jim@apache.org>
Thu, 30 Aug 2007 12:44:42 +0000 (12:44 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 30 Aug 2007 12:44:42 +0000 (12:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@571143 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/ssl/ssl_engine_init.c
modules/ssl/ssl_engine_vars.c
modules/ssl/ssl_util_ssl.h

diff --git a/CHANGES b/CHANGES
index b0ad231cd99892fa8485414ac3527959382f9298..efefa8c45ce989b26299342ad72a221cbc733711 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,13 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.0.61
 
+  *) mod_ssl: Version reporting update; displays 'compiled against'
+     Apache and build-time SSL Library versions at loglevel [info],
+     while reporting the run-time SSL Library version in the server
+     info tags.  Helps to identify a mod_ssl built against one flavor
+     of OpenSSL but running against another (also adds SSL-C version
+     number reporting.)  [William Rowe]
+
   *) mod_autoindex: Add in Type and Charset options to IndexOptions
      directive. This allows the admin to explicitly set the
      content-type and charset of the generated page.
diff --git a/STATUS b/STATUS
index 221d687452f19ebed0f431d0b94e3646e3eccfea..687d37ea917377ab4687f8af3c0ee9faaeef5123 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -124,17 +124,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
         http://people.apache.org/~wrowe/r569535-backport-2.0-r2.patch
       +1: wrowe, rpluem, jim
 
-    * mod_ssl: Version reporting update; displays 'compiled against'
-      Apache and build-time SSL Library versions at loglevel [info],
-      while reporting the run-time SSL Library version in the server
-      info tags.  Helps to identify a mod_ssl built against one flavor
-      of OpenSSL but running against another (also adds SSL-C version
-      number reporting.)  [William Rowe]
-        http://svn.apache.org/viewvc?view=rev&revision=520701
-      Backported to 2.0 (applies with a bit of fuzz);
-        http://people.apache.org/~wrowe/r520701-backport-2.2.patch
-      +1: wrowe, rpluem, jim
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ please place SVN revisions from trunk here, so it is easy to
     identify exactly what the proposed changes are!  Add all new
index dff0c5e35fa5268dd0db80d89c8e521be3d6cc1b..14b23551f09b0b33750f8f11eeb269b58d460a5e 100644 (file)
 **  _________________________________________________________________
 */
 
-static char *ssl_add_version_component(apr_pool_t *p,
-                                       server_rec *s,
-                                       char *name)
-{
-    char *val = ssl_var_lookup(p, s, NULL, NULL, name);
-
-    if (val && *val) {
-        ap_add_version_component(p, val);
-    }
-
-    return val;
-}
-
-static char *version_components[] = {
-    "SSL_VERSION_PRODUCT",
-    "SSL_VERSION_INTERFACE",
-    "SSL_VERSION_LIBRARY",
-    NULL
-};
 
 static void ssl_add_version_components(apr_pool_t *p,
                                        server_rec *s)
 {
-    char *vals[sizeof(version_components)/sizeof(char *)];
-    int i;
+    char *modver = ssl_var_lookup(p, s, NULL, NULL, "SSL_VERSION_INTERFACE");
+    char *libver = ssl_var_lookup(p, s, NULL, NULL, "SSL_VERSION_LIBRARY");
+    char *incver = ssl_var_lookup(p, s, NULL, NULL, 
+                                  "SSL_VERSION_LIBRARY_INTERFACE");
 
-    for (i=0; version_components[i]; i++) {
-        vals[i] = ssl_add_version_component(p, s,
-                                            version_components[i]);
-    }
+    ap_add_version_component(p, modver);
+    ap_add_version_component(p, libver);
 
     ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
-                 "Server: %s, Interface: %s, Library: %s",
-                 AP_SERVER_BASEVERSION,
-                 vals[1],  /* SSL_VERSION_INTERFACE */
-                 vals[2]); /* SSL_VERSION_LIBRARY */
+                 "%s compiled against Server: %s, Library: %s",
+                 modver, AP_SERVER_BASEVERSION, incver);
 }
 
 
index 08ea62d642f87f468e3ce2e992c9041b1c43e447..1195a82845fd1d91fa95f89d5b2c6a21f8b932ce 100644 (file)
@@ -569,31 +569,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;
 }
+  
 
 /*  _________________________________________________________________
 **
index f0aa74141b5f9bacb9e11f2952506496605412f3..d5c48f16ebe5ddd37d084e2b9a20a87cda71b0af 100644 (file)
 /*
  * Determine SSL library version number
  */
+#define SSL_NIBBLE(x,n) ((x >> (n * 4)) & 0xF)
+
 #ifdef OPENSSL_VERSION_NUMBER
 #define SSL_LIBRARY_VERSION OPENSSL_VERSION_NUMBER
 #define SSL_LIBRARY_NAME    "OpenSSL"
 #define SSL_LIBRARY_TEXT    OPENSSL_VERSION_TEXT
+#define SSL_LIBRARY_DYNTEXT SSLeay_version(SSLEAY_VERSION)
+#elif defined(SSLC_VERSION_NUMBER)
+#define SSL_LIBRARY_VERSION SSLC_VERSION_NUMBER
+#define SSL_LIBRARY_NAME    "SSL-C"
+#define SSL_LIBRARY_TEXT    { 'S', 'S', 'L', '-', 'C', ' ', \
+                              '0' + SSL_NIBBLE(SSLC_VERSION_NUMBER,3), '.', \
+                              '0' + SSL_NIBBLE(SSLC_VERSION_NUMBER,2), '.', \
+                              '0' + SSL_NIBBLE(SSLC_VERSION_NUMBER,1), '.', \
+                              '0' + SSL_NIBBLE(SSLC_VERSION_NUMBER,0), 0 }
+#define SSL_LIBRARY_DYNTEXT SSLC_library_info(SSLC_INFO_VERSION)
 #elif !defined(SSL_LIBRARY_VERSION)
 #define SSL_LIBRARY_VERSION 0x0000
 #define SSL_LIBRARY_NAME    "OtherSSL"
 #define SSL_LIBRARY_TEXT    "OtherSSL 0.0.0 00 XXX 0000"
+#define SSL_LIBRARY_DYNTEXT "OtherSSL 0.0.0 00 XXX 0000"
 #endif
 
 /*