85
85
86
86
#endif /* defined(LIBRESSL_VERSION_NUMBER) */
87
87
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
90
89
#define APR_USE_OPENSSL_ENGINE_API 1
91
90
#else
92
91
#define APR_USE_OPENSSL_ENGINE_API 0
@@ -213,7 +212,9 @@ static apr_status_t crypto_shutdown(void)
213
212
214
213
ERR_free_strings ();
215
214
EVP_cleanup ();
215
+ #if APR_USE_OPENSSL_ENGINE_API
216
216
ENGINE_cleanup ();
217
+ #endif
217
218
#endif
218
219
219
220
return APR_SUCCESS ;
@@ -236,7 +237,9 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
236
237
*
237
238
* We tell openssl we want to include engine support.
238
239
*/
240
+ #if APR_USE_OPENSSL_ENGINE_API
239
241
OPENSSL_init_crypto (OPENSSL_INIT_ENGINE_ALL_BUILTIN , NULL );
242
+ #endif
240
243
241
244
#else
242
245
/* 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,
251
254
ERR_load_crypto_strings ();
252
255
/* SSL_load_error_strings(); */
253
256
OpenSSL_add_all_algorithms ();
257
+ #if APR_USE_OPENSSL_ENGINE_API
254
258
ENGINE_load_builtin_engines ();
255
259
ENGINE_register_all_complete ();
260
+ #endif
256
261
#endif
257
262
258
263
apr_pool_cleanup_register (pool , pool , crypto_shutdown_helper ,
0 commit comments