Skip to content

Commit 317be19

Browse files
committed
apr_crypto_openssl: Remove remaining ENGINE references on openssl3+
git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/branches/1.7.x@1924434 13f79535-47bb-0310-9956-ffa450edef68
1 parent d31283d commit 317be19

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crypto/apr_crypto_openssl.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@
8585

8686
#endif /* defined(LIBRESSL_VERSION_NUMBER) */
8787

88-
#if APR_USE_OPENSSL_PRE_3_0_API \
89-
|| (defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL < 30000)
88+
#if APR_USE_OPENSSL_PRE_3_0_API
9089
#define APR_USE_OPENSSL_ENGINE_API 1
9190
#else
9291
#define APR_USE_OPENSSL_ENGINE_API 0
@@ -213,7 +212,9 @@ static apr_status_t crypto_shutdown(void)
213212

214213
ERR_free_strings();
215214
EVP_cleanup();
215+
#if APR_USE_OPENSSL_ENGINE_API
216216
ENGINE_cleanup();
217+
#endif
217218
#endif
218219

219220
return APR_SUCCESS;
@@ -236,7 +237,9 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
236237
*
237238
* We tell openssl we want to include engine support.
238239
*/
240+
#if APR_USE_OPENSSL_ENGINE_API
239241
OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL);
242+
#endif
240243

241244
#else
242245
/* Configuration below is for legacy versions Openssl v1.0 and
@@ -251,8 +254,10 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
251254
ERR_load_crypto_strings();
252255
/* SSL_load_error_strings(); */
253256
OpenSSL_add_all_algorithms();
257+
#if APR_USE_OPENSSL_ENGINE_API
254258
ENGINE_load_builtin_engines();
255259
ENGINE_register_all_complete();
260+
#endif
256261
#endif
257262

258263
apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper,

0 commit comments

Comments
 (0)