opencryptoki/0002-Fix-unused-variable-d_size-Werror-unused-variable-wi.patch

38 lines
1.3 KiB
Diff

From ca1ac6235b9d6231578a8487dc441d1ca2a3dfd9 Mon Sep 17 00:00:00 2001
From: Ingo Franzki <ifranzki@linux.ibm.com>
Date: Fri, 3 Jul 2026 08:51:49 +0200
Subject: [PATCH] =?UTF-8?q?Fix=20unused=20variable=20=E2=80=98d=5Fsize?=
=?UTF-8?q?=E2=80=99=20[-Werror=3Dunused-variable]=20with=20OpenSSL=201.1.?=
=?UTF-8?q?1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Move the variable declaration of 'd_size' into the >= OpenSSL 3.0.0 block,
it is only used when building with OpenSSL >= 3.0.0.
Fixes: https://github.com/opencryptoki/opencryptoki/commit/627d27514e7494d36d3d7924e03e4e23ac76bec3
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
---
usr/lib/common/mech_openssl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/usr/lib/common/mech_openssl.c b/usr/lib/common/mech_openssl.c
index 85d7d49ae..b1b70a160 100644
--- a/usr/lib/common/mech_openssl.c
+++ b/usr/lib/common/mech_openssl.c
@@ -2564,10 +2564,11 @@ CK_RV openssl_specific_ec_generate_keypair(STDLL_TokData_t *tokdata,
#else
BIGNUM *bn_d = NULL;
int len;
+ size_t d_size;
#endif
CK_BYTE *ecpoint = NULL, *enc_ecpoint = NULL, *d = NULL;
CK_ULONG enc_ecpoint_len, d_len;
- size_t ecpoint_len, d_size;
+ size_t ecpoint_len;
EVP_PKEY_CTX *ctx = NULL;
EVP_PKEY *ec_pkey = NULL;
int nid, pkey_type;