altarch-user / rpms / httpd

Forked from rpms/httpd 2 years ago
Clone

Blame SOURCES/httpd-2.4.6-ssl-error-free.patch

008793
diff --git a/modules/ssl/mod_ssl.c b/modules/ssl/mod_ssl.c
008793
index 19d3ec7..926e05e 100644
008793
--- a/modules/ssl/mod_ssl.c
008793
+++ b/modules/ssl/mod_ssl.c
008793
@@ -295,9 +295,12 @@ static apr_status_t ssl_cleanup_pre_config(void *data)
008793
 #endif
008793
     ERR_remove_state(0);
008793
 
008793
-    /* Don't call ERR_free_strings here; ERR_load_*_strings only
008793
-     * actually load the error strings once per process due to static
008793
+    /* Don't call ERR_free_strings in earlier versions, ERR_load_*_strings only
008793
+     * actually loaded the error strings once per process due to static
008793
      * variable abuse in OpenSSL. */
008793
+#if (OPENSSL_VERSION_NUMBER >= 0x00090805f)
008793
+    ERR_free_strings();
008793
+#endif
008793
 
008793
     /* Also don't call CRYPTO_cleanup_all_ex_data here; any registered
008793
      * ex_data indices may have been cached in static variables in
008793
diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
008793
index 8425acb..508991e 100644
008793
--- a/modules/ssl/ssl_engine_init.c
008793
+++ b/modules/ssl/ssl_engine_init.c
008793
@@ -1065,7 +1065,7 @@ static void ssl_init_server_certs(server_rec *s,
008793
     const char *ecc_id;
008793
     EC_GROUP *ecparams;
008793
     int nid;
008793
-    EC_KEY *eckey;
008793
+    EC_KEY *eckey = NULL;
008793
 #endif
008793
     const char *vhost_id = mctx->sc->vhost_id;
008793
     int i;
008793
@@ -1151,10 +1151,11 @@ static void ssl_init_server_certs(server_rec *s,
008793
 #if defined(SSL_CTX_set_ecdh_auto)
008793
         SSL_CTX_set_ecdh_auto(mctx->ssl_ctx, 1);
008793
 #else
008793
-        SSL_CTX_set_tmp_ecdh(mctx->ssl_ctx,
008793
-                             EC_KEY_new_by_curve_name(NID_X9_62_prime256v1));
008793
+        eckey = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
008793
+        SSL_CTX_set_tmp_ecdh(mctx->ssl_ctx, eckey);
008793
 #endif
008793
     }
008793
+    EC_KEY_free(eckey);
008793
 #endif
008793
 }
008793