From: Antonio Quartulli <antonio@openvpn.net>
To: netdev@vger.kernel.org
Cc: Antonio Quartulli <antonio@openvpn.net>,
Sabrina Dubroca <sd@queasysnail.net>,
Jakub Kicinski <kuba@kernel.org>, Ralf Lici <ralf@mandelbit.com>,
linux-kselftest@vger.kernel.org, Shuah Khan <shuah@kernel.org>
Subject: [RFC net-next 01/13] selftests: ovpn: allow compiling ovpn-cli.c with mbedtls3
Date: Fri, 21 Nov 2025 01:20:32 +0100 [thread overview]
Message-ID: <20251121002044.16071-2-antonio@openvpn.net> (raw)
In-Reply-To: <20251121002044.16071-1-antonio@openvpn.net>
mbedtls 3 installs headers and calls the shared object
differently than version 2, therefore we must now rely
on pkgconfig to fill the right C/LDFLAGS.
Moreover the mbedtls3 library expects any base64 file to
have their content on one line.
Since this change does no break older versions,
let's change the sample key file format and make mbedtls3
happy.
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
---
tools/testing/selftests/net/ovpn/Makefile | 14 ++++++++++----
tools/testing/selftests/net/ovpn/data64.key | 6 +-----
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/net/ovpn/Makefile b/tools/testing/selftests/net/ovpn/Makefile
index dbe0388c8512..d3a070db0bb5 100644
--- a/tools/testing/selftests/net/ovpn/Makefile
+++ b/tools/testing/selftests/net/ovpn/Makefile
@@ -2,19 +2,25 @@
# Copyright (C) 2020-2025 OpenVPN, Inc.
#
CFLAGS = -pedantic -Wextra -Wall -Wl,--no-as-needed -g -O0 -ggdb $(KHDR_INCLUDES)
+CFLAGS += $(shell pkg-config --cflags mbedcrypto-3 mbedtls-3 2>/dev/null)
+
VAR_CFLAGS = $(shell pkg-config --cflags libnl-3.0 libnl-genl-3.0 2>/dev/null)
ifeq ($(VAR_CFLAGS),)
VAR_CFLAGS = -I/usr/include/libnl3
endif
CFLAGS += $(VAR_CFLAGS)
+MTLS_LDLIBS= $(shell pkg-config --libs mbedcrypto-3 mbedtls-3 2>/dev/null)
+ifeq ($(MTLS_LDLIBS),)
+MTLS_LDLIBS = -lmbedtls -lmbedcrypto
+endif
+LDLIBS += $(MTLS_LDLIBS)
-LDLIBS = -lmbedtls -lmbedcrypto
-VAR_LDLIBS = $(shell pkg-config --libs libnl-3.0 libnl-genl-3.0 2>/dev/null)
+NL_LDLIBS = $(shell pkg-config --libs libnl-3.0 libnl-genl-3.0 2>/dev/null)
ifeq ($(VAR_LDLIBS),)
-VAR_LDLIBS = -lnl-genl-3 -lnl-3
+NL_LDLIBS = -lnl-genl-3 -lnl-3
endif
-LDLIBS += $(VAR_LDLIBS)
+LDLIBS += $(NL_LDLIBS)
TEST_FILES = common.sh
diff --git a/tools/testing/selftests/net/ovpn/data64.key b/tools/testing/selftests/net/ovpn/data64.key
index a99e88c4e290..d04febcdf5a2 100644
--- a/tools/testing/selftests/net/ovpn/data64.key
+++ b/tools/testing/selftests/net/ovpn/data64.key
@@ -1,5 +1 @@
-jRqMACN7d7/aFQNT8S7jkrBD8uwrgHbG5OQZP2eu4R1Y7tfpS2bf5RHv06Vi163CGoaIiTX99R3B
-ia9ycAH8Wz1+9PWv51dnBLur9jbShlgZ2QHLtUc4a/gfT7zZwULXuuxdLnvR21DDeMBaTbkgbai9
-uvAa7ne1liIgGFzbv+Bas4HDVrygxIxuAnP5Qgc3648IJkZ0QEXPF+O9f0n5+QIvGCxkAUVx+5K6
-KIs+SoeWXnAopELmoGSjUpFtJbagXK82HfdqpuUxT2Tnuef0/14SzVE/vNleBNu2ZbyrSAaah8tE
-BofkPJUBFY+YQcfZNM5Dgrw3i+Bpmpq/gpdg5w==
+jRqMACN7d7/aFQNT8S7jkrBD8uwrgHbG5OQZP2eu4R1Y7tfpS2bf5RHv06Vi163CGoaIiTX99R3Bia9ycAH8Wz1+9PWv51dnBLur9jbShlgZ2QHLtUc4a/gfT7zZwULXuuxdLnvR21DDeMBaTbkgbai9uvAa7ne1liIgGFzbv+Bas4HDVrygxIxuAnP5Qgc3648IJkZ0QEXPF+O9f0n5+QIvGCxkAUVx+5K6KIs+SoeWXnAopELmoGSjUpFtJbagXK82HfdqpuUxT2Tnuef0/14SzVE/vNleBNu2ZbyrSAaah8tEBofkPJUBFY+YQcfZNM5Dgrw3i+Bpmpq/gpdg5w==
--
2.51.2
next prev parent reply other threads:[~2025-11-21 0:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-21 0:20 [RFC net-next 00/13] ovpn: new features + kselftests Antonio Quartulli
2025-11-21 0:20 ` Antonio Quartulli [this message]
2025-11-21 0:20 ` [RFC net-next 02/13] selftests: ovpn: add notification parsing and matching Antonio Quartulli
2025-11-21 10:56 ` Antonio Quartulli
2025-11-24 15:51 ` Sabrina Dubroca
2025-11-25 10:21 ` Ralf Lici
2025-11-21 0:20 ` [RFC net-next 03/13] ovpn: use correct array size to parse nested attributes in ovpn_nl_key_swap_doit Antonio Quartulli
2025-11-21 0:20 ` [RFC net-next 04/13] ovpn: pktid: use bitops.h API Antonio Quartulli
2025-11-21 0:20 ` [RFC net-next 05/13] ovpn: notify userspace on client float event Antonio Quartulli
2025-11-21 0:20 ` [RFC net-next 06/13] ovpn: add support for asymmetric peer IDs Antonio Quartulli
2025-11-21 0:20 ` [RFC net-next 07/13] selftests: ovpn: check asymmetric peer-id Antonio Quartulli
2025-11-27 0:13 ` Sabrina Dubroca
2025-12-02 16:11 ` Ralf Lici
2025-11-21 0:20 ` [RFC net-next 08/13] selftests: ovpn: add test for the FW mark feature Antonio Quartulli
2025-11-27 11:09 ` Sabrina Dubroca
2025-12-02 16:22 ` Ralf Lici
2025-11-21 0:20 ` [RFC net-next 09/13] ovpn: consolidate crypto allocations in one chunk Antonio Quartulli
2025-11-21 0:20 ` [RFC net-next 10/13] ovpn: use bound device in UDP when available Antonio Quartulli
2025-11-21 0:20 ` [RFC net-next 11/13] selftests: ovpn: add test for bound device Antonio Quartulli
2025-11-27 11:29 ` Sabrina Dubroca
2025-12-02 16:28 ` Ralf Lici
2025-11-21 0:20 ` [RFC net-next 12/13] ovpn: use bound address in UDP when available Antonio Quartulli
2025-11-21 0:20 ` [RFC net-next 13/13] selftests: ovpn: add test for bound address Antonio Quartulli
2025-11-27 14:34 ` Sabrina Dubroca
2025-12-02 16:34 ` Ralf Lici
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251121002044.16071-2-antonio@openvpn.net \
--to=antonio@openvpn.net \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ralf@mandelbit.com \
--cc=sd@queasysnail.net \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).