From 45ebe47569603d5ba77907b6be03f3f17e407ee1 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 2 Sep 2024 18:39:11 +0200 Subject: [PATCH] Autotools: Sync CS in ext/openssl --- ext/openssl/config0.m4 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4 index 7c8dac5bdca..70ecb0af0c8 100644 --- a/ext/openssl/config0.m4 +++ b/ext/openssl/config0.m4 @@ -25,7 +25,9 @@ PHP_ARG_WITH([openssl-argon2], [no]) if test "$PHP_OPENSSL" != "no"; then - PHP_NEW_EXTENSION([openssl], [openssl.c openssl_pwhash.c xp_ssl.c], [$ext_shared]) + PHP_NEW_EXTENSION([openssl], + [openssl.c openssl_pwhash.c xp_ssl.c], + [$ext_shared]) PHP_SUBST([OPENSSL_SHARED_LIBADD]) PHP_SETUP_OPENSSL([OPENSSL_SHARED_LIBADD], [AC_DEFINE([HAVE_OPENSSL_EXT], [1], @@ -46,13 +48,14 @@ if test "$PHP_OPENSSL" != "no"; then [Define to 1 to load the OpenSSL legacy algorithm provider in addition to the default provider.])]) - if test "$PHP_OPENSSL_ARGON2" != "no"; then - if test "$PHP_THREAD_SAFETY" != "no"; then - AC_MSG_ERROR([Not supported in ZTS mode for now]) - fi + AS_VAR_IF([PHP_OPENSSL_ARGON2], [no],, [ + AS_VAR_IF([PHP_THREAD_SAFETY], [yes], + [AC_MSG_ERROR([Not supported in ZTS mode for now])]) + PHP_CHECK_LIBRARY([crypto], [OSSL_set_max_threads], - [AC_DEFINE([HAVE_OPENSSL_ARGON2], [1], [ Define to 1 to enable argon2 password hashing ])], + [AC_DEFINE([HAVE_OPENSSL_ARGON2], [1], + [Define to 1 to enable OpenSSL argon2 password hashing.])], [AC_MSG_ERROR([argon2 hashing requires OpenSSL 3.2])], [$OPENSSL_LIBS]) - fi + ]) fi