summaryrefslogtreecommitdiffstats
path: root/php-8.3.0-openssl-ec-param.patch
blob: 94e4037fcec5e9cf821c0ca50ab2d8b82606b4b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 21f9d16e130b412b6839494dcf30a2f1d7dcee0f Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 24 Jul 2023 10:54:49 +0200
Subject: [PATCH] Always warn about missing curve_name

Both Fedora and RHEL do not support arbitrary EC parameters
See https://bugzilla.redhat.com/2223953
---
 ext/openssl/openssl.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 33f51bfa4d..340b0467d3 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4299,13 +4299,8 @@ static bool php_openssl_pkey_init_legacy_ec(EC_KEY *eckey, zval *data, bool *is_
 		OPENSSL_PKEY_SET_BN(data, b);
 		OPENSSL_PKEY_SET_BN(data, order);
 
+		php_error_docref(NULL, E_WARNING, "Missing params: curve_name (params only is not supported by OpenSSL)");
 		if (!(p && a && b && order)) {
-			if (!p && !a && !b && !order) {
-				php_error_docref(NULL, E_WARNING, "Missing params: curve_name");
-			} else {
-				php_error_docref(
-					NULL, E_WARNING, "Missing params: curve_name or p, a, b, order");
-			}
 			goto clean_exit;
 		}
 
@@ -4455,12 +4450,8 @@ static EVP_PKEY *php_openssl_pkey_init_ec(zval *data, bool *is_private) {
 		OPENSSL_PKEY_SET_BN(data, b);
 		OPENSSL_PKEY_SET_BN(data, order);
 
+		php_error_docref(NULL, E_WARNING, "Missing params: curve_name");
 		if (!(p && a && b && order)) {
-			if (!p && !a && !b && !order) {
-				php_error_docref(NULL, E_WARNING, "Missing params: curve_name");
-			} else {
-				php_error_docref(NULL, E_WARNING, "Missing params: curve_name or p, a, b, order");
-			}
 			goto cleanup;
 		}
 
-- 
2.41.0