On Sun, Jul 22, 2018 at 3:11 PM, <minf...@apache.org> wrote: > --- apr/apr/trunk/crypto/apr_crypto_openssl.c (original) > +++ apr/apr/trunk/crypto/apr_crypto_openssl.c Sun Jul 22 13:11:32 2018 > > @@ -106,16 +143,87 @@ static apr_status_t crypto_error(const a > */ > static apr_status_t crypto_shutdown(void) > { > - return apr_crypto_lib_term("openssl"); > + ERR_free_strings(); > + EVP_cleanup(); > + ENGINE_cleanup(); > + return APR_SUCCESS; > +}
So you reverted this... > + > +static apr_status_t crypto_shutdown_helper(void *data) > +{ > + return crypto_shutdown(); > } > > /** > * Initialise the crypto library and perform one time initialisation. > */ > static apr_status_t crypto_init(apr_pool_t *pool, const char *params, > - const apu_err_t **result) > + const apu_err_t **result) > +{ > +#if APR_USE_OPENSSL_PRE_1_1_API > + (void)CRYPTO_malloc_init(); > +#else > + OPENSSL_malloc_init(); > +#endif > + ERR_load_crypto_strings(); > + /* SSL_load_error_strings(); */ > + OpenSSL_add_all_algorithms(); > + ENGINE_load_builtin_engines(); > + ENGINE_register_all_complete(); > + > + apr_pool_cleanup_register(pool, pool, crypto_shutdown_helper, > + apr_pool_cleanup_null); > + > + return APR_SUCCESS; > +} > - return apr_crypto_lib_init("openssl", params, result, pool); ... and this (including for the other libs), because? The goal was to allow the initialization of the crypto libs independently from DSOs (openssl, for instance, does not play very well there). In httpd there is (at least) APR, the httpd core, mod_ssl and mod_md that can all use the crypto library, how is each one supposed to initialize it? I thought it was nice for APR to provide a single initializer, once for all, with the lifetime of the given pool (as usual)... Regards, Yann.