[php-src] Issue #9064: PHP fails to build if openssl was built with --no-ec

From: Date: Wed, 20 Jul 2022 12:54:47 +0000
Subject: [php-src] Issue #9064: PHP fails to build if openssl was built with --no-ec
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-241955@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/9064 Author: Lex-2008 ### Description Looking at openssl.c: * HAVE_EVP_PKEY_EC is defined only if OPENSSL_NO_EC is defined: https://github.com/php/php-src/blob/php-8.1.8/ext/openssl/openssl.c#L89 ``` #if !defined(OPENSSL_NO_EC) && defined(EVP_PKEY_EC) #define HAVE_EVP_PKEY_EC 1 #endif ``` * OPENSSL_KEYTYPE_EC is defined only if HAVE_EVP_PKEY_EC is defined: https://github.com/php/php-src/blob/php-8.1.8/ext/openssl/openssl.c#L107 ``` #ifdef HAVE_EVP_PKEY_EC OPENSSL_KEYTYPE_EC = OPENSSL_KEYTYPE_DH +1 #endif ``` * but then on line 4899 it is used without proper #ifdef's: https://github.com/php/php-src/blob/php-8.1.8/ext/openssl/openssl.c#L4898 ``` case EVP_PKEY_EC: { ktype = OPENSSL_KEYTYPE_EC; ``` Worth noting that further down it's properly #ifdef'd out: https://github.com/php/php-src/blob/php-8.1.8/ext/openssl/openssl.c#L5003 ``` #ifdef HAVE_EVP_PKEY_EC case EVP_PKEY_EC: ktype = OPENSSL_KEYTYPE_EC; ``` Probably it should be #ifdef'd on line 4899, too? ### PHP Version 8.1.8 ### Operating System _No response_

« previous php.bugs (#241955) next »