29055c7
From 21f9d16e130b412b6839494dcf30a2f1d7dcee0f Mon Sep 17 00:00:00 2001
29055c7
From: Remi Collet <remi@remirepo.net>
29055c7
Date: Mon, 24 Jul 2023 10:54:49 +0200
29055c7
Subject: [PATCH] Always warn about missing curve_name
29055c7
29055c7
Both Fedora and RHEL do not support arbitrary EC parameters
29055c7
See https://bugzilla.redhat.com/2223953
29055c7
---
29055c7
 ext/openssl/openssl.c | 13 ++-----------
29055c7
 1 file changed, 2 insertions(+), 11 deletions(-)
29055c7
29055c7
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
29055c7
index 33f51bfa4d..340b0467d3 100644
29055c7
--- a/ext/openssl/openssl.c
29055c7
+++ b/ext/openssl/openssl.c
29055c7
@@ -4299,13 +4299,8 @@ static bool php_openssl_pkey_init_legacy_ec(EC_KEY *eckey, zval *data, bool *is_
29055c7
 		OPENSSL_PKEY_SET_BN(data, b);
29055c7
 		OPENSSL_PKEY_SET_BN(data, order);
29055c7
 
29055c7
+		php_error_docref(NULL, E_WARNING, "Missing params: curve_name (params only is not supported by OpenSSL)");
29055c7
 		if (!(p && a && b && order)) {
29055c7
-			if (!p && !a && !b && !order) {
29055c7
-				php_error_docref(NULL, E_WARNING, "Missing params: curve_name");
29055c7
-			} else {
29055c7
-				php_error_docref(
29055c7
-					NULL, E_WARNING, "Missing params: curve_name or p, a, b, order");
29055c7
-			}
29055c7
 			goto clean_exit;
29055c7
 		}
29055c7
 
29055c7
@@ -4455,12 +4450,8 @@ static EVP_PKEY *php_openssl_pkey_init_ec(zval *data, bool *is_private) {
29055c7
 		OPENSSL_PKEY_SET_BN(data, b);
29055c7
 		OPENSSL_PKEY_SET_BN(data, order);
29055c7
 
29055c7
+		php_error_docref(NULL, E_WARNING, "Missing params: curve_name");
29055c7
 		if (!(p && a && b && order)) {
29055c7
-			if (!p && !a && !b && !order) {
29055c7
-				php_error_docref(NULL, E_WARNING, "Missing params: curve_name");
29055c7
-			} else {
29055c7
-				php_error_docref(NULL, E_WARNING, "Missing params: curve_name or p, a, b, order");
29055c7
-			}
29055c7
 			goto cleanup;
29055c7
 		}
29055c7
 
29055c7
-- 
29055c7
2.41.0
29055c7