Skip to content

Commit 90ae54b

Browse files
alan-maguireAlexei Starovoitov
authored andcommitted
bpftool: Allow bpftool to build with openssl < 3
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: 40863f4 ("bpftool: Add support for signing BPF programs") Signed-off-by: Alan Maguire <[email protected]> Acked-by: Song Liu <[email protected]> Acked-by: Quentin Monnet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent acf8726 commit 90ae54b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/bpf/bpftool/sign.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828

2929
#define OPEN_SSL_ERR_BUF_LEN 256
3030

31+
/* Use deprecated in 3.0 ERR_get_error_line_data for openssl < 3 */
32+
#if !defined(OPENSSL_VERSION_MAJOR) || (OPENSSL_VERSION_MAJOR < 3)
33+
#define ERR_get_error_all(file, line, func, data, flags) \
34+
ERR_get_error_line_data(file, line, data, flags)
35+
#endif
36+
3137
static void display_openssl_errors(int l)
3238
{
3339
char buf[OPEN_SSL_ERR_BUF_LEN];

0 commit comments

Comments
 (0)