Commit 4617b306 authored by Alexei Starovoitov's avatar Alexei Starovoitov
Browse files

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: default avatarAlexei Starovoitov <ast@kernel.org>
parents acf87264 ad93ba02
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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];
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ test_tcpnotify_user
test_libbpf
xdping
test_cpp
test_progs_verification_cert
*.d
*.subskel.h
*.skel.h
+4 −2
Original line number Diff line number Diff line
@@ -731,7 +731,8 @@ $(VERIFICATION_CERT) $(PRIVATE_KEY): $(VERIFY_SIG_SETUP)
	$(Q)$(VERIFY_SIG_SETUP) genkey $(BUILD_DIR)

$(VERIFY_SIG_HDR): $(VERIFICATION_CERT)
	$(Q)xxd -i -n test_progs_verification_cert $< > $@
	$(Q)ln -fs $< test_progs_verification_cert && \
	xxd -i test_progs_verification_cert > $@

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

.PHONY: docs docs-clean