From: Viktor Szakats Date: Mon, 7 Aug 2023 16:32:46 +0000 (+0000) Subject: openssl: switch to modern init for LibreSSL 2.7.0+ X-Git-Tag: curl-8_3_0~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bec0c5bbf34369920598678161d2df8bea0e243b;p=thirdparty%2Fcurl.git openssl: switch to modern init for LibreSSL 2.7.0+ LibreSSL 2.7.0 (2018-03-21) introduced automatic initialization, `OPENSSL_init_ssl()` function and deprecated the old, manual init method, as seen in OpenSSL 1.1.0. Switch to the modern method when available. Ref: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.0-relnotes.txt Reviewed-by: Daniel Stenberg Closes #11611 --- diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 36d841f35e..2a7369fa54 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1691,7 +1691,7 @@ static int x509_name_oneline(X509_NAME *a, char *buf, size_t size) static int ossl_init(void) { #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && \ - !defined(LIBRESSL_VERSION_NUMBER) + (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) const uint64_t flags = #ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN /* not present in BoringSSL */