Skip to content

Commit 4617b30

Browse files
author
Alexei Starovoitov
committed
Merge branch 'ease-bpf-signing-build-requirements'
Alan Maguire says: ==================== Ease BPF signing build requirements This series makes it easier to build bpftool and selftests with signing support, removing reliance on >= openssl v3 (supporting openssl v1) to build bpftool and not requiring latest xxd to build verification cert header in selftests. Changes since v1 [1]: - Updated patch 2 to add symlink test_progs_verification_cert to .gitignore, EXTRA_CLEANFILES (AI review bot) - Added acks to patch 1 (Song, Quentin) [1] https://lore.kernel.org/bpf/20251114222249.30122-1-alan.maguire@oracle.com/ ==================== Link: https://patch.msgid.link/20251120084754.640405-1-alan.maguire@oracle.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2 parents acf8726 + ad93ba0 commit 4617b30

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
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];

tools/testing/selftests/bpf/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ test_tcpnotify_user
2323
test_libbpf
2424
xdping
2525
test_cpp
26+
test_progs_verification_cert
2627
*.d
2728
*.subskel.h
2829
*.skel.h

tools/testing/selftests/bpf/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,8 @@ $(VERIFICATION_CERT) $(PRIVATE_KEY): $(VERIFY_SIG_SETUP)
731731
$(Q)$(VERIFY_SIG_SETUP) genkey $(BUILD_DIR)
732732

733733
$(VERIFY_SIG_HDR): $(VERIFICATION_CERT)
734-
$(Q)xxd -i -n test_progs_verification_cert $< > $@
734+
$(Q)ln -fs $< test_progs_verification_cert && \
735+
xxd -i test_progs_verification_cert > $@
735736

736737
# Define test_progs test runner.
737738
TRUNNER_TESTS_DIR := prog_tests
@@ -905,7 +906,8 @@ EXTRA_CLEAN := $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \
905906
$(addprefix $(OUTPUT)/,*.o *.d *.skel.h *.lskel.h *.subskel.h \
906907
no_alu32 cpuv4 bpf_gcc \
907908
liburandom_read.so) \
908-
$(OUTPUT)/FEATURE-DUMP.selftests
909+
$(OUTPUT)/FEATURE-DUMP.selftests \
910+
test_progs_verification_cert
909911

910912
.PHONY: docs docs-clean
911913

0 commit comments

Comments
 (0)