1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-10 02:02:49 +03:00

Narrow the scope of several OPENSSL-specific setup and teardown calls

to only OpenSSL based builds.

  Also introduce success result for the registered cleanup callback
  to clean up a compiler emit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100348 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
William A. Rowe Jr
2003-06-24 21:40:32 +00:00
parent ace2765ea7
commit 94d918ff59

View File

@@ -235,7 +235,7 @@ static apr_status_t ssl_cleanup_pre_config(void *data)
/* /*
* Try to kill the internals of the SSL library. * Try to kill the internals of the SSL library.
*/ */
#ifdef OPENSSL_VERSION_NUMBER #ifdef HAVE_OPENSSL
#if OPENSSL_VERSION_NUMBER >= 0x00907001 #if OPENSSL_VERSION_NUMBER >= 0x00907001
/* Corresponds to OPENSSL_load_builtin_modules(): /* Corresponds to OPENSSL_load_builtin_modules():
* XXX: borrowed from apps.h, but why not CONF_modules_free() * XXX: borrowed from apps.h, but why not CONF_modules_free()
@@ -249,7 +249,11 @@ static apr_status_t ssl_cleanup_pre_config(void *data)
#if HAVE_ENGINE_LOAD_BUILTIN_ENGINES #if HAVE_ENGINE_LOAD_BUILTIN_ENGINES
ENGINE_cleanup(); ENGINE_cleanup();
#endif #endif
#ifdef HAVE_OPENSSL
#if OPENSSL_VERSION_NUMBER >= 0x00907001
CRYPTO_cleanup_all_ex_data(); CRYPTO_cleanup_all_ex_data();
#endif
#endif
ERR_remove_state(0); ERR_remove_state(0);
ERR_free_strings(); ERR_free_strings();
/* /*
@@ -257,6 +261,7 @@ static apr_status_t ssl_cleanup_pre_config(void *data)
* (when enabled) at this late stage in the game: * (when enabled) at this late stage in the game:
* CRYPTO_mem_leaks_fp(stderr); * CRYPTO_mem_leaks_fp(stderr);
*/ */
return APR_SUCCESS;
} }
static int ssl_hook_pre_config(apr_pool_t *pconf, static int ssl_hook_pre_config(apr_pool_t *pconf,
@@ -267,12 +272,14 @@ static int ssl_hook_pre_config(apr_pool_t *pconf,
* code can successfully test the SSL environment. * code can successfully test the SSL environment.
*/ */
CRYPTO_malloc_init(); CRYPTO_malloc_init();
#ifdef HAVE_OPENSSL
ERR_load_crypto_strings(); ERR_load_crypto_strings();
#endif
SSL_library_init(); SSL_library_init();
#if HAVE_ENGINE_LOAD_BUILTIN_ENGINES #if HAVE_ENGINE_LOAD_BUILTIN_ENGINES
ENGINE_load_builtin_engines(); ENGINE_load_builtin_engines();
#endif #endif
#ifdef OPENSSL_VERSION_NUMBER #ifdef HAVE_OPENSSL
#if OPENSSL_VERSION_NUMBER >= 0x00907001 #if OPENSSL_VERSION_NUMBER >= 0x00907001
OPENSSL_load_builtin_modules(); OPENSSL_load_builtin_modules();
#endif #endif