From a4071b20115c7d4e808df81169a986e65cec4efa Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Thu, 28 May 2020 15:59:19 -0700 Subject: [PATCH] crypto_openssl: add initialization to pick up local configuration The test programme for the new openssl engine code requires overriding the system default configuration file to point to the location of the test engine. Add an initialization stanza that makes this behaviour universal, so now anyone running openvpn configured with openssl can specify their own configuration file with the OPENSSL_CONF environment variable. Signed-off-by: James Bottomley Acked-by: Arne Schwabe Message-Id: <20200528225920.6983-3-James.Bottomley@HansenPartnership.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19936.html Signed-off-by: Gert Doering --- src/openvpn/crypto_openssl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index 4ac77fdef..fd57edd22 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -149,6 +149,11 @@ crypto_init_lib_engine(const char *engine_name) void crypto_init_lib(void) { +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) + OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL); +#else + OPENSSL_config(NULL); +#endif /* * If you build the OpenSSL library and OpenVPN with * CRYPTO_MDEBUG, you will get a listing of OpenSSL -- 2.47.2