openssl: define HAVE_OPENSSL_VERSION for OpenSSL 1.1.0+

Prior to this change OpenSSL_version was only detected in configure
builds. For other builds the old version parsing code was used which
would result in incorrect versioning for OpenSSL 3:

Before:

curl 7.80.0 (i386-pc-win32) libcurl/7.80.0 OpenSSL/3.0.0a zlib/1.2.11
WinIDN libssh2/1.9.0

After:

curl 7.80.0 (i386-pc-win32) libcurl/7.80.0 OpenSSL/3.0.1 zlib/1.2.11
WinIDN libssh2/1.9.0

Reported-by: lllaffer@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/8154
Closes https://github.com/curl/curl/pull/8155
This commit is contained in:
Jay Satiro 2021-12-15 14:45:34 -05:00
parent cb26b2c7a7
commit 79d6057f1b
2 changed files with 15 additions and 11 deletions

View file

@ -535,11 +535,8 @@ if test "x$OPT_OPENSSL" != xno; then
if test X"$OPENSSL_ENABLED" = X"1"; then
dnl These can only exist if OpenSSL exists
dnl OpenSSL_version is introduced in 3.0.0
AC_CHECK_FUNCS( RAND_egd \
SSLv2_client_method \
OpenSSL_version )
AC_CHECK_FUNCS( RAND_egd )
AC_MSG_CHECKING([for BoringSSL])
AC_COMPILE_IFELSE([