summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlan Maguire <alan.maguire@oracle.com>2025-11-20 08:47:53 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-18 14:03:16 +0100
commit489a8f559fafe6a72f44aeff81de44259d5d37fe (patch)
treef98dc715e73239c3cae475625df0e988ae2874ee /tools
parent3d12cc5d13f6dc98b128e5c666417b6e2df6406a (diff)
downloadlinux-489a8f559fafe6a72f44aeff81de44259d5d37fe.tar.gz
linux-489a8f559fafe6a72f44aeff81de44259d5d37fe.tar.bz2
linux-489a8f559fafe6a72f44aeff81de44259d5d37fe.zip
bpftool: Allow bpftool to build with openssl < 3
[ Upstream commit 90ae54b4c7eca42d5ce006dd0a8cb0b5bfbf80d0 ] ERR_get_error_all()[1] is a openssl v3 API, so to make code compatible with openssl v1 utilize ERR_get_err_line_data instead. Since openssl is already a build requirement for the kernel (minimum requirement openssl 1.0.0), this will allow bpftool to compile where opensslv3 is not available. Signing-related BPF selftests pass with openssl v1. [1] https://docs.openssl.org/3.4/man3/ERR_get_error/ Fixes: 40863f4d6ef2 ("bpftool: Add support for signing BPF programs") Signed-off-by: Alan Maguire <alan.maguire@oracle.com> Acked-by: Song Liu <song@kernel.org> Acked-by: Quentin Monnet <qmo@kernel.org> Link: https://lore.kernel.org/r/20251120084754.640405-2-alan.maguire@oracle.com Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/bpf/bpftool/sign.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/sign.c b/tools/bpf/bpftool/sign.c
index b34f74d210e9..f9b742f4bb10 100644
--- a/tools/bpf/bpftool/sign.c
+++ b/tools/bpf/bpftool/sign.c
@@ -28,6 +28,12 @@
#define OPEN_SSL_ERR_BUF_LEN 256
+/* Use deprecated in 3.0 ERR_get_error_line_data for openssl < 3 */
+#if !defined(OPENSSL_VERSION_MAJOR) || (OPENSSL_VERSION_MAJOR < 3)
+#define ERR_get_error_all(file, line, func, data, flags) \
+ ERR_get_error_line_data(file, line, data, flags)
+#endif
+
static void display_openssl_errors(int l)
{
char buf[OPEN_SSL_ERR_BUF_LEN];