package/iperf3: fix build with LibreSSL

iperf3 3.22 added a new "goto errreturn" to decrypt_rsa_message(), on
a code path that is common to all OpenSSL versions, but the
errreturn label is only defined when OPENSSL_VERSION_MAJOR >= 3.
LibreSSL does not define OPENSSL_VERSION_MAJOR, so the build fails
with:

iperf_auth.c: In function 'decrypt_rsa_message':
iperf_auth.c:343:9: error: label 'errreturn' used but not defined
  343 |         goto errreturn;   /* or: return 0; — never read more than output_buffer_len bytes */
      |         ^~~~

Backport the upstream commit that defines the label unconditionally.

This issue has been present since commit cb129a641b ("package/iperf3:
security bump version to 3.22"), as the broken code first appeared in
iperf 3.22. That commit is not part of any release nor of any
maintenance branch yet, so only master is affected, but this fix
should go along with the 3.22 bump if it gets backported.

Fixes:
https://autobuild.buildroot.org/results/6ed8f60f56f7fcd11eaa1ba160837275b8113e1a

Fixes: cb129a641b ("package/iperf3: security bump version to 3.22")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Yegor Yefremov
2026-10-20 10:15:57 +02:00
committed by Thomas Petazzoni
parent 97179e17d4
commit 8a6f6aff73

View File

@@ -0,0 +1,29 @@
From 96208f2e413d7fddc19e6888be5fbd2acdb04606 Mon Sep 17 00:00:00 2001
From: Peter G <55786000+WatcherOfTheSkies@users.noreply.github.com>
Date: Wed, 30 Sep 2026 12:27:43 +0100
Subject: [PATCH] Remove OpenSSL version check in iperf_auth.c
Removed conditional compilation for OpenSSL version check.
Upstream: https://github.com/esnet/iperf/commit/96208f2e413d7fddc19e6888be5fbd2acdb04606
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
src/iperf_auth.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/iperf_auth.c b/src/iperf_auth.c
index 51d1a1b6e..cf0bd7449 100644
--- a/src/iperf_auth.c
+++ b/src/iperf_auth.c
@@ -380,11 +380,9 @@ int decrypt_rsa_message(const unsigned char *encryptedtext, const int encryptedt
return plaintext_len;
-#if OPENSSL_VERSION_MAJOR >= 3
errreturn:
fprintf(stderr, "%s\n", ERR_error_string(ERR_get_error(), NULL));
return 0;
-#endif
}
int encode_auth_setting(const char *username, const char *password, EVP_PKEY *public_key, char **authtoken, int use_pkcs1_padding){