From dea5055fd9bd456bdb401e664cb026d73d4d5ea4 Mon Sep 17 00:00:00 2001 From: sthen Date: Mon, 12 Dec 2022 13:30:58 +0000 Subject: [PATCH] php/8.2: adjust #ifdef around #include to match the #ifdef around a call to ENGINE_cleanup, to avoid implicit declaration with libressl: php-8.2.0/ext/openssl/openssl.c:1329:2: warning: implicit declaration of function 'ENGINE_cleanup' is invalid in C99 [-Wimplicit-function-declaration] --- lang/php/8.2/Makefile | 1 + lang/php/8.2/patches/patch-ext_openssl_openssl_c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/lang/php/8.2/Makefile b/lang/php/8.2/Makefile index 09a61a3d1a7..78c1ef5f19b 100644 --- a/lang/php/8.2/Makefile +++ b/lang/php/8.2/Makefile @@ -2,6 +2,7 @@ BROKEN-sparc64= fibers requires either ucontext or asm code (not present for spa PHP_VERSION= 8.2.0 PHP_PKGSPEC= >=8.2,<8.3 +REVISION-main= 0 DEBUG_PACKAGES= ${BUILD_PACKAGES} diff --git a/lang/php/8.2/patches/patch-ext_openssl_openssl_c b/lang/php/8.2/patches/patch-ext_openssl_openssl_c index 61ae19c1b25..a18b9d69fbb 100644 --- a/lang/php/8.2/patches/patch-ext_openssl_openssl_c +++ b/lang/php/8.2/patches/patch-ext_openssl_openssl_c @@ -1,3 +1,9 @@ +#1: +ENGINE_cleanup() is used in a block gated by OPENSSL_VERSION_NUMBER < +0x10100000L || defined(LIBRESSL_VERSION_NUMBER), so make sure that the +header defining this is gated by the same ifdef. + +#2: This check doesn't make sense for EC keys. (Also it ignores the default key size compiled into libcrypto, only looks at default_bits in openssl.cnf and any settings in the php file, which results in bogus failures). @@ -5,6 +11,15 @@ and any settings in the php file, which results in bogus failures). Index: ext/openssl/openssl.c --- ext/openssl/openssl.c.orig +++ ext/openssl/openssl.c +@@ -61,7 +61,7 @@ + #include + #endif + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L && !defined(OPENSSL_NO_ENGINE) ++#if (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)) && !defined(OPENSSL_NO_ENGINE) + #include + #endif + @@ -3662,7 +3662,7 @@ static int php_openssl_get_evp_pkey_type(int key_type) /* {{{ php_openssl_generate_private_key */ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req)