From 2431b206408167111f06e4444d6e8570525dc342 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 25 Mar 2024 21:21:47 +0100 Subject: [PATCH] BUILD: ssl: fix build error on older compilers with openssl-3.2 OpenSSL 3.2 triggers the code part added by commit 25da217 ("MINOR: ssl: Update ssl_fc_curve/ssl_bc_curve to use SSL_get0_group_name") which contains a variable declaration in the for() statement and breaks on older compilers, as reported in GH issues #2501. Let's just declare it normally to fix the problem. This must be backported wherever the commit above is (at least 2.9). --- src/ssl_sample.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ssl_sample.c b/src/ssl_sample.c index 99d9dbc25..5e7a278d7 100644 --- a/src/ssl_sample.c +++ b/src/ssl_sample.c @@ -1405,7 +1405,9 @@ smp_fetch_ssl_fc_ec(const struct arg *args, struct sample *smp, const char *kw, * different functional calls and to make it consistent while upgrading OpenSSL versions, * will convert the curve name returned by SSL_get0_group_name to upper case. */ - for (int i = 0; curve_name[i]; i++) + int i; + + for (i = 0; curve_name[i]; i++) curve_name[i] = toupper(curve_name[i]); } # else