]> git.ipfire.org Git - thirdparty/openvpn.git/log
thirdparty/openvpn.git
100 min agoRemove --providers from --help output for Mbed TLS master
Max Fillinger [Wed, 22 Jul 2026 16:37:55 +0000 (18:37 +0200)] 
Remove --providers from --help output for Mbed TLS

This option is OpenSSL-only. When used with Mbed TLS, it prints warnings
and does not do anything. With this change, the option is still parsed,
to ensure compatiblity of configurations, but it is removed from the
--help text.

Change-Id: I0f56ca69efae0ca376eb9eae064a893c8768188e
Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1799
Message-Id: <20260722163800.2474-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37781.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 hours agoMake --x509-username-field work with Mbed TLS
Max Fillinger [Wed, 22 Jul 2026 15:25:14 +0000 (17:25 +0200)] 
Make --x509-username-field work with Mbed TLS

In pre-2.7 versions, this option was not available in the Mbed TLS
build. This was changed in 2.7, but the option did not do anything when
Mbed TLS was selected as the crypto library. Regardless of the field
chosen with --x509-username-field, OpenVPN would always extract the CN
as username.

This could lead to a situation where an unintended certificate gets
accepted by OpenVPN: If we run with "--x509-username-field serialNumber"
and "--verify-x509-name 0x05 name", OpenVPN would accept a certificate
with CN=0x05 and an incorrect serial number, while a certificate with
the correct serial number would be rejected. (Though note that to
exploit this, an attacker needs to make the CA sign a certificate
with a hexadecimal number in the CN.)

This commit adds code to backend_x509_get_username to extract the
correct field values from X509 certificates. It also changes the
behavior of the function to match the OpenSSL version when the output
buffer is too small. (With Mbed TLS, the function would silently
truncate the output and return SUCCESS.)

It also adds unit tests for extracting the values of different fields.

Despite this commit fixing a CVE, we have decided not to keep it under
embargo until the release of the next version because it is unlikely to
be exploitable in practice: Someone has to run OpenVPN 2.7 with Mbed
TLS, use the --x509-username-field option even though it didn't exist in
Mbed TLS builds of earlier versions, not notice that the intended
certificate is *not* accepted, and then an attacker has to get the CA to
sign a certificate with a weird common name.

CVE: 2026-63650
Github: openvpn/openvpn-private-issues#144
Reported-By: Hcamael
Reported-By: 章鱼哥 (www.aipyaipy.com)
Change-Id: Ic183f1f1f90561454b7b1128c95255368427cc4a
Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1801
Message-Id: <20260722152521.22272-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37773.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
39 hours agosilence autoconf warnings about openvpnserv_testdriver_CFLAGS etc
Gert Doering [Mon, 20 Jul 2026 11:38:32 +0000 (13:38 +0200)] 
silence autoconf warnings about openvpnserv_testdriver_CFLAGS etc

Github: OpenVPN/openvpn#1079

Change-Id: I5295e5d26c5bf60cd9607da4c804d04f2144634a
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1796
Message-Id: <20260720113838.19668-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37699.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
5 days agoMove incoming data processing in its own method
Arne Schwabe [Fri, 17 Jul 2026 14:14:37 +0000 (16:14 +0200)] 
Move incoming data processing in its own method

This extract a large chunk from multi_process_incoming_link into its
own method multi_process_incoming_link_data

This reduces the complexity of multi_process_incoming_link further.

A few declarations were moved into a more logical place but otherwise
this is just a simple move.

Change-Id: I9f10d91407347faf32397535c95e2d80a1575bd5
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1722
Message-Id: <20260717141442.22943-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37674.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 days agoproto: correct 802.1Q length check in is_ipv_X
rootvector2 [Wed, 15 Jul 2026 20:22:02 +0000 (22:22 +0200)] 
proto: correct 802.1Q length check in is_ipv_X

Github: OpenVPN/openvpn#1044

This has also been reported twice as a security relevant bug, but
only later than the original finding - and it isn't.

While --client-nat would modify a 32bit integer "after the packet"
(the place where an IPv4 address would be, in a well-formed packet),
the underlying buffer is always max-frame sized, and we never look
at the "modified integer" afterwards, so there are no consequences
warranting allocation of a CVE ID.

Signed-off-by: rootvector2 <dxbnaveed.k@gmail.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Acked-by: Antonio Quartulli <antonio@mandelbit.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1789
Reported-By: 章鱼哥 (www.aipyaipy.com)
Reported-By: Yu Zhang Wong <wongyuzhang45@gmail.com>
Change-Id: I8219c6295acf28ff10ddb2fcc285f813c42fa8fe
Message-Id: <20260715202210.9010-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37652.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
7 days agoReplace strtok with strtok_r
Arne Schwabe [Wed, 8 Jul 2026 15:31:07 +0000 (17:31 +0200)] 
Replace strtok with strtok_r

This does not change anything in our source code but makes compiling
with newer Android NDKs (version 30 pre release) -Werror safe again
as it has started throwing warning on this.

The compat version is taken from current FreeBSD (commit dc36d6f9bb1)
src/lib/libc/string/strtok.c and reformatted to our clang standard.

Change-Id: I70560efd113308b7377424127eb2c1da4266371a
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1679
Message-Id: <20260708153107.60809-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37538.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 days agotest_tls_crypt: Fix test failure on Windows
Frank Lichtenheld [Tue, 14 Jul 2026 12:12:29 +0000 (14:12 +0200)] 
test_tls_crypt: Fix test failure on Windows

- Exclude tests that use verify_script on Windows.
  We currently do not have openvpn_execve available
  for Windows tests. It would also need more work
  to replace the hardcoded paths.
- Use platform_gen_path instead of hard-coding /
  Do to the previous change that is not strictly
  necessary, but it also doesn't hurt and it fixes
  at least one issue if anyone ever decides to port
  this to Windows).

Change-Id: I45ddc8e350d3948b3197ae725df102d8ce73fa77
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1781
Message-Id: <20260714121238.13936-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37593.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 days agobuffer: Add buf_read_u64() and buf_write_u64()
Lev Stipakov [Tue, 14 Jul 2026 09:25:46 +0000 (11:25 +0200)] 
buffer: Add buf_read_u64() and buf_write_u64()

Add 64-bit big-endian buffer accessors alongside the existing 8/16/32-bit
helpers, using htonll()/ntohll() for the byte-order conversion.

buf_read_u64() reports success via a bool out-parameter, mirroring
buf_read_u32().

Change-Id: Ic677f43fc3eb0052f8e80d9a7f098d34ad03dfe1
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1740
Message-Id: <20260714092552.18685-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37578.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 days agot_client.sh.in: Do not run resolvectl if systemd is not running
Frank Lichtenheld [Mon, 13 Jul 2026 15:18:11 +0000 (17:18 +0200)] 
t_client.sh.in: Do not run resolvectl if systemd is not running

In some cases we will have resolvectl installed but no
running systemd. E.g. on old Ubuntu distros resolvectl
is part of the main systemd package which we have installed
as a build-dependency.

Supress the warnings from resolvectl in this case.

Change-Id: I677d3206c24aad997889ed76fb8eca2e6f4b1259
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1778
Message-Id: <20260713151816.22005-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37566.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
9 days agoCMake: detect cmocka_version.h via include path, not by linking
Lev Stipakov [Thu, 9 Jul 2026 14:42:40 +0000 (16:42 +0200)] 
CMake: detect cmocka_version.h via include path, not by linking

check_include_files() was invoked with cmocka in CMAKE_REQUIRED_LIBRARIES,
which makes the probe link the (shared, imported) cmocka library. On some
platforms that link step fails inside the minimal probe, so the header check
reports failure and HAVE_CMOCKA_VERSION_H is left undefined even though
cmocka_version.h is present.

test_common.h then selects its cmocka 1.x compatibility shims and redefines
macros (check_expected_uint, expect_uint_value, ...) that cmocka 2.x already
provides, which breaks the -Werror build of every unit test driver.

Detecting a header only needs the include search path, so pass cmocka's
INTERFACE_INCLUDE_DIRECTORIES via CMAKE_REQUIRED_INCLUDES and drop the library
link requirement from the probe.

Change-Id: Icc14b286f2409738c73873aa7550dcc005ee8cbb
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1739
Message-Id: <20260709144240.61362-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37552.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 weeks agossl_pkt: Fix doxygen warning about read_control_auth
Frank Lichtenheld [Thu, 2 Jul 2026 10:06:59 +0000 (12:06 +0200)] 
ssl_pkt: Fix doxygen warning about read_control_auth

Commit 01ee1693f960a696a613e7b83f9960002264a379
("Ensure tls-crypt keys are not setup twice") removed
the argument but did not delete it from the doxygen
documentation, leading to warnings.

Change-Id: I20cc89a546b69aceadcd1630828de407d530d7c7
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1765
Message-Id: <20260702100704.24692-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37459.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 weeks agotest_tls_crypt: Fix issue with temp file name on big endian systems
Frank Lichtenheld [Thu, 2 Jul 2026 07:47:40 +0000 (09:47 +0200)] 
test_tls_crypt: Fix issue with temp file name on big endian systems

Encountered by Fedora s390x build instances.

Change-Id: Iba577d662b389de539b81034735e437199cb495d
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1761
Message-Id: <20260702074746.3129-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37454.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 weeks agoEnsure tls-crypt keys are not setup twice
Arne Schwabe [Thu, 18 Jun 2026 14:33:43 +0000 (16:33 +0200)] 
Ensure tls-crypt keys are not setup twice

Commit 82ee2fe4b42d already did this when the session id stayed the same
but forgot the other code path that could also lead to tls-crypt keys to be
setup.

This approach was a bit too fragile as it missed some other code path
that might trigger the same behaviour. This commit changes the logic
to directly infer if the key is already initialised instead of taking
a proxy (like key state as the previous commit did).

The fix in commit 7a6ab5773 (#121, #127) made sure that we do not try
to extract the tls-crypt-v2 key multiple times and made the unit test
basically not work as the extraction was skipped and then could also
not fail anymore. I could work around it in the unit test but improving
tls_wrap_free felt preferable.

CVE: 2026-13698
Reported-By: Max Fillinger <maximilian.fillinger@sentyron.com>
Github: OpenVPN/openvpn-private-issues#137
Github: OpenVPN/openvpn-private-issues#138

Change-Id: I3b5e4e84762aa253d46e69103f7b1e84ebefca1d
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-By: Max Fillinger <maximilian.fillinger@sentyron.com>
3 weeks agoopenvpnserv: fix DNS SearchList state pollution on (dis)connect
Lev Stipakov [Fri, 22 May 2026 09:05:43 +0000 (12:05 +0300)] 
openvpnserv: fix DNS SearchList state pollution on (dis)connect

RemoveDnsSearchDomains used wcsstr on the comma-separated SearchList,
so removing a VPN-pushed domain like "vpn.corp.local" could match
inside an unrelated pre-existing entry like "test.vpn.corp.local"
and corrupt it. The wmemmove length was also too short, truncating
the tail of the list when the removed segment was shorter than what
followed. The wcsncmp against InitialSearchList was prefix-only too,
so a shortened list that happened to be a prefix of the initial one
triggered a spurious reset.

Replace the manual cut with two pure helpers that are unit-tested in
test_openvpnserv.c:

* AppendSearchList just appends the requested string, with a separator
  comma if the list is non-empty. No deduplication: pushed domains are
  always appended verbatim.

* RemoveSearchListTokens uses multiset semantics. For each comma-
  separated token in the undo string it finds the last remaining
  token in the list that fully matches (no substring) and splices it
  out in place. If a domain appears K times in the list and L times in
  the undo set, min(K, L) instances are removed.

Together these properties give the right behavior under overlap:

  user has "corp.local"; VPN pushes "corp.local"
    -> SearchList = "corp.local,corp.local"
    -> on disconnect one occurrence is removed, user's entry preserved.

  session A pushes "openvpn.com"; session B pushes "openvpn.com"
    -> SearchList = "openvpn.com,openvpn.com"
    -> A disconnects: one removed, B still sees its domain.
    -> B disconnects: list returns to original.

AddDnsSearchDomains and RemoveDnsSearchDomains are now thin wrappers
around the helpers: read SearchList, call the helper, write back,
plus the StoreInitialDnsSearchList / ResetDnsSearchDomains dance.

CVE: 2026-13379
Reported-By: 章鱼哥 (www.aipyaipy.com)
GitHub: OpenVPN/openvpn-private-issues#123
GitHub: OpenVPN/openvpn-private-issues#124

Change-Id: Idad2b3662e98541c916e630c2f55108380cc432f
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Heiko Hund <heiko@openvpn.net>
3 weeks agoFix ack_write_buf use after free
Max Fillinger [Fri, 22 May 2026 14:55:13 +0000 (16:55 +0200)] 
Fix ack_write_buf use after free

If the active TLS session has a pending dedicated ACK packet,
tls_multi_process sets to_link to ks->ack_write_buf. If in the same
execution of tls_multi_process, the initializing session reaches the
authenticated stage, the active session will be freed which leaves
to_link.data pointing to freed memory.

This commit extends check_session_buf_not_used so that it also checks
ks->ack_write_buf for all key states.

CVE: 2026-12996
Github: OpenVPN/openvpn-private-issues#121
Github: OpenVPN/openvpn-private-issues#127
Reported-By: Hcamael
Reported-By: 章鱼哥 (www.aipyaipy.com)
Github: OpenVPN/openvpn-private-issues#131
Reported-By: Haiyang Huang <huanghaiyang83@gmail.com>
Github: OpenVPN/openvpn-private-issues#132
Reported-By: Haruki Oyama (Waseda University)
Change-Id: Ia6aee772999d87b45a51bf5855c4f266ad7fb3f4
Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com>
Acked-By: Arne Schwabe <arne@rfc2549.org>
3 weeks agoFix tls_wrap_reneg use after free
Max Fillinger [Fri, 22 May 2026 12:34:57 +0000 (14:34 +0200)] 
Fix tls_wrap_reneg use after free

When dynamic tls-crypt is active, it is possible for tls_multi_process
to set to_link to session->tls_wrap_reneg.work and later free that
session, leaving to_link.data pointing to freed memory.

This is not caught by the function check_session_buf_not_used because it
checks only tls_wrap, not tls_wrap_reneg. This commit adds that check.

CVE: 2026-13117
Github: OpenVPN/openvpn-private-issues#119
Github: OpenVPN/openvpn-private-issues#125
Reported-By: Trace37 Labs (https://github.com/trace37labs)
Github: OpenVPN/openvpn-private-issues#131
Reported-By: Haiyang Huang <huanghaiyang83@gmail.com>
Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com>
Acked-By: Arne Schwabe <arne@rfc2549.org>
3 weeks agoEnsure we only get the session from valid tokens for external-auth
Arne Schwabe [Wed, 20 May 2026 23:07:34 +0000 (23:07 +0000)] 
Ensure we only get the session from valid tokens for external-auth

This also improves is_auth_token to check for the correct length and
adds a few unit tests.

This fixes an assertion when a user would send auth token with the
right prefix but overall too short length.

Reported-By: Haiyang Huang <huanghaiyang83@gmail.com>
CVE: 2026-13122
Github: OpenVPN/openvpn-private-issues#118
Github: OpenVPN/openvpn-private-issues#128

Change-Id: I053cca5f42e3841cef8934c2114a8a159fbc0c29
Acked-by: MaxF <max@max-fillinger.net>
3 weeks agoClean up metadata handling in tls_crypt_v2_extract_client_key
Arne Schwabe [Mon, 15 Jun 2026 18:35:07 +0000 (20:35 +0200)] 
Clean up metadata handling in tls_crypt_v2_extract_client_key

This makes the metadata a local variable instead of a member of the
wrap_context struct. Also always ensure that this buffer is freed to
avoid any leak of the metadata buffer.

This touches the check methods. Ensure that they still work as
intended by adding unit tests for both script and age checks.

CVE: 2026-12932
Github: OpenVPN/openvpn-private-issues#133
Github: OpenVPN/openvpn-private-issues#136

Reported-By: Valton Tahiri <valton.taa@gmail.com>
Acked-by: MaxF <max@max-fillinger.net>
Change-Id: I9b8b8afcc5d4d5914b2008c0efccb309f0d07d4b

3 weeks agodco.c: fix argument order in dco_install_key() log string
Ralf Lici [Wed, 1 Jul 2026 07:41:15 +0000 (09:41 +0200)] 
dco.c: fix argument order in dco_install_key() log string

The debug log in dco_install_key() has the epoch and dco_keys_installed
arguments swapped. So a line like epoch=1, currently 0 keys installed
actually means dco_keys_installed == 1 and epoch == false.

Use the correct argument ordering in the log string.

Change-Id: Id8945dce437da11e6fecae9550c3be52e393d4cf
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1760
Message-Id: <20260701074122.28795-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37418.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 weeks agodoc: clarify that --float only applies to UDP
Sami Rusani [Mon, 29 Jun 2026 21:45:17 +0000 (21:45 +0000)] 
doc: clarify that --float only applies to UDP

The --float option lets OpenVPN accept authenticated packets from a
changed peer address. That only applies to UDP transports.

Document the transport limitation in the man page.

Github: fixes OpenVPN/openvpn#358
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <SXGKysQ5xx6qb0pPY8pAk_wO-B0Pl44xmifYB_bBdqIXMtGir8GTPKxhB2kivfBvPO2uU9bBnxbJVTTy2IDBqXlumDVRYOLOE-qEZfea5TQ=@pm.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37401.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 weeks agoDocument --preresolve option
Sami Rusani [Sat, 27 Jun 2026 19:03:51 +0000 (21:03 +0200)] 
Document --preresolve option

The option resolves configured remote, local, and proxy hostnames at
startup and reuses those resolved addresses on reconnects.

Document it in the usage text and client options man page, including
the reconnect trade-off for configurations that rely on changing DNS
answers.

GitHub: fixes OpenVPN/openvpn#532
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <_5bQ5LvkEmn_vaE7Ng8xPAcHJFWfy7td0Yvim0iLc3YVoer2RM1-PoBKAGPzHZKx1rsZP7Ht7kM_2eIUSidNkMW34yS7eT549_fSvcb-dl0=@pm.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37387.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 weeks agowin32: fix plugin trusted-dir check prefix bypass
Lev Stipakov [Mon, 29 Jun 2026 12:48:34 +0000 (14:48 +0200)] 
win32: fix plugin trusted-dir check prefix bypass

plugin_in_trusted_dir() validated the plugin path against the trusted
plugin/install directory (and the system directory fallback) using a raw
string prefix match via wcsnicmp(). When the trusted directory path does
not end in a separator (e.g. the plugin_dir registry value is set to
"C:\openvpn_plugins"), a sibling directory sharing the same prefix
("C:\openvpn_plugins_evil") also passes the check, allowing a plugin to
be loaded from outside the allow-listed directory.

Introduce win_path_in_dir() in win32-util.c which performs the prefix
match but additionally requires the match to end on a path-component
boundary, and use it for both the plugin/install directory and the
system directory checks. Add unit tests in test_misc.c.

Change-Id: Ib7f9c9ce5ed778190445cc4cfaa8f3cd5d1110bc
Reported-By: 章鱼哥 (@AiPy) (www.aipyaipy.com)
Github: OpenVPN/openvpn-private-issues#120
Reported-by: <genco@srlabs.de>
Github: OpenVPN/openvpn-private-issues#109
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1736
Message-Id: <20260629124839.32433-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37382.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 weeks agoopenvpnserv: rework ConvertItfDnsDomains and tests
Heiko Hund [Sun, 28 Jun 2026 13:02:50 +0000 (15:02 +0200)] 
openvpnserv: rework ConvertItfDnsDomains and tests

Since there were issues with in-place modification of the buffer
repeatedly, re-implement ConvertItfDnsDomains() to use a internal
temporary buffer to prevent use of memmove and the length calculations
that come with it. Code should be easier to grasp since we're dealing
with one set of lengths (WCHARs) instead of two (WCHARs + octets) now.

The unit tests did not actually test the MULTI_SZs correctly, fixed
that and also added some more tests to cover more scenarios.

This was initially reported as a security vulnerability, as the previous
code could be tricked into overreading a buffer and accessing undefined
memory - but we decided against assigning a CVE ID because the data read
is subsequently never leaked anywhere, and it was not possible to trigger
a crash, so "just a bug, no security implications".

Reported-By: 章鱼哥 (@AiPy) (www.aipyaipy.com)
Github: OpenVPN/openvpn-private-issues#122
Github: OpenVPN/openvpn-private-issues#126

Change-Id: I8c67633ed3d82a6dc50fbd8fa1af2c50fc45d938
Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1730
Message-Id: <20260628130255.25452-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37337.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 weeks agoChange hash values in our hash map from uint32_t to uint64_t
Arne Schwabe [Sun, 28 Jun 2026 21:00:27 +0000 (23:00 +0200)] 
Change hash values in our hash map from uint32_t to uint64_t

32 bit architectures are playing a very small role today, so the difference
between 64 bit and 32 bit hash values is not expected to be large anymore.

This is also in preparation to replace our hash function with a more modern
replacement.

Change-Id: Ib8140107f98164d2a2e1768a6d8ac65016cd7f7c
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1570
Message-Id: <20260628210033.4583-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37349.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 weeks agoRemove an indention layer from multi_process_incoming_link
Arne Schwabe [Sun, 28 Jun 2026 15:02:30 +0000 (17:02 +0200)] 
Remove an indention layer from multi_process_incoming_link

This also move the gc area acquire release to the small parts where they
are actually used.

Change-Id: I401aab94993b62bf18e66561532085f99e62f745
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1721
Message-Id: <20260628150235.13113-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37341.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 weeks agoFix building wolfSSL with CMake
Arne Schwabe [Sun, 28 Jun 2026 15:03:15 +0000 (17:03 +0200)] 
Fix building wolfSSL with CMake

Change-Id: I355760e43c3e2da0dda0cdec6e4253c028cefe38
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1604
Message-Id: <20260628150320.13244-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37342.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 weeks agoExtract handle_connection_attempt from multi_get_create_instance_udp
Arne Schwabe [Sun, 28 Jun 2026 13:04:55 +0000 (15:04 +0200)] 
Extract handle_connection_attempt from multi_get_create_instance_udp

The multi_get_create_instance_udp is quite large. This factors out the
one branch that handles and creates new connection attempts.

Change-Id: I6a032465e66b49ab0ce8b1a84ead8d9acef918de
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1720
Message-Id: <20260628130500.26086-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37336.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 weeks agoMake get_random return int64 instead of long
Arne Schwabe [Fri, 26 Jun 2026 15:29:46 +0000 (17:29 +0200)] 
Make get_random return int64 instead of long

This avoids having get_ranomd being different on 32bit/Windows vs
64 bit Unix platform. Also adjust platform_create_temp_file to
create the same files on all platforms.

Change-Id: Ifefb3ad204c0c16cb4952dd6e8661fdc9136b125
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1732
Message-Id: <20260626152951.29207-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37322.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
4 weeks agooptions: fix use-after-free of DNS options on client connect
Antonio Quartulli [Mon, 22 Jun 2026 12:08:51 +0000 (14:08 +0200)] 
options: fix use-after-free of DNS options on client connect

struct dns_options embeds its own gc_arena. When inherit_context_child()
/inherit_context_top() copy struct options by value, the child shares the
parent's DNS arena. options_detach() detached o->gc but not
o->dns_options.gc, so pre_connect_restore()'s gc_free() (and context
teardown) freed allocations the parent still referenced.

With one or more non-pushed --dhcp-option directives that yield a DNS
entry, a connecting client triggers this and the server crashes
(use-after-free in setenv_dns_options(), reported as a double free).

Detach o->dns_options.gc as well, mirroring the existing o->gc handling.

Change-Id: I49b37b5a90554fa2d4a83c8fc5608dad2a36b835
GitHub: closes openvpn/OpenVPN#1060
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1715
Message-Id: <20260622120856.21586-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37230.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
4 weeks agooptions: Move <= 0 check for keepalive settings earlier
Frank Lichtenheld [Thu, 14 May 2026 19:27:21 +0000 (21:27 +0200)] 
options: Move <= 0 check for keepalive settings earlier

Use the atoi_constrained function.

Change-Id: Ic9ac18f730e6035126ccf1cf19799548e5fd9316
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1155
Message-Id: <20260514192727.31903-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36939.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
4 weeks agodns: Fix memory leak in dns_server_addr_parse
saddamr3e [Thu, 18 Jun 2026 06:18:28 +0000 (08:18 +0200)] 
dns: Fix memory leak in dns_server_addr_parse

When the DNS server's address count is already full (exceeds the
limit of 8), the function returned early without freeing the
successfully resolved addrinfo struct. Fix this by checking the
limit before executing the DNS lookup.

Github: OpenVPN/openvpn#1055
Change-Id: I7ec318c86af994284d1c6272e3bbe2b1ede160fd
Signed-off-by: saddamr3e <saddamr3e@gmail.com>
Acked-by: Heiko Hund <heiko@openvpn.net>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1712
Message-Id: <20260618061835.16448-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37209.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
5 weeks agoMultisocket: use event engine rwflags for UDP I/O
Gianmarco De Gregori [Tue, 16 Jun 2026 16:21:23 +0000 (18:21 +0200)] 
Multisocket: use event engine rwflags for UDP I/O

udp_flags does not guarantee correct association with the socket being
processed. Use the rwflags delivered by the event engine along with the
event to ensure proper per-socket I/O handling.

Remove udp_flags entirely.

Replace the previous global-style flag computation with a per-socket
decision model in p2mp_iow_flags(), which derives I/O flags
directly from the current multi_context state and the specific socket
being processed. This ensures that read/write decisions are correctly
bound to the active socket rather than shared or implicit global state.

This change is based on an investigation triggered by a report from
Joshua Rogers using ZeroPath.

Change-Id: I6b303805a3688b6f6363140c76853a58badecd8f
Signed-off-by: Gianmarco De Gregori <gianmarco@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1635
Message-Id: <20260616162129.28519-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37198.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
5 weeks agopush: Fix conversion issues related to timeout in send_auth_pending_messages
Frank Lichtenheld [Fri, 12 Jun 2026 11:33:02 +0000 (13:33 +0200)] 
push: Fix conversion issues related to timeout in send_auth_pending_messages

Add additional checking to make sure that the required
casts are safe.

Change-Id: Icc31b7fa0da86220df45552aecc15dc6c769cd54
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1293
Message-Id: <20260612113309.29903-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37184.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
5 weeks agombuf: Fix conversion warnings in mbuf and related code
Frank Lichtenheld [Fri, 12 Jun 2026 11:04:17 +0000 (13:04 +0200)] 
mbuf: Fix conversion warnings in mbuf and related code

Mostly these were actually hidden by casts, but fix
them as well by using more fitting types.

Change-Id: I1d4e0233cf1cb09725dbd2caa121acdbf62f0452
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1433
Message-Id: <20260612110424.27033-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37182.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
5 weeks agoAWS-LC: Add casts and openssl_opt_t typdef to allow AWS-LC with -Werror
Arne Schwabe [Tue, 9 Jun 2026 15:52:21 +0000 (17:52 +0200)] 
AWS-LC: Add casts and openssl_opt_t typdef to allow AWS-LC with -Werror

Change-Id: I88254e985d67234d827b92908079795df23daf20
Signed-off-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1637
Message-Id: <20260609155226.30827-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37145.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agoAWS-LC: Use openssl_stack_size_t for declaring stack size
Arne Schwabe [Tue, 9 Jun 2026 15:52:06 +0000 (17:52 +0200)] 
AWS-LC: Use openssl_stack_size_t for declaring stack size

OpenSSL and AWS-LC disagree on the type that they use for
stack size. Instead of doing a lot of various casts, use
a typedef to avoid these casts and use the right type for
each library.

Change-Id: Ifd29485524674c64d56fc5f7ef8bdd1e00215fc9
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1627
Message-Id: <20260609155211.30747-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37144.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agoGHA: Switch to using VS 2026
Frank Lichtenheld [Tue, 9 Jun 2026 15:21:17 +0000 (17:21 +0200)] 
GHA: Switch to using VS 2026

Since Github will switch to windows-2025 image to use
VS 2026 at some point in the near future (according to
https://github.blog/changelog/2026-02-05-github-actions-early-february-2026-updates/#windows-server-2025-with-visual-studio-2026-image-now-available-for-github-hosted-runners)
enforce that switch to avoid any build failures. Since
we hardcode the VS version in CMakePresets.json (and I
do not see an easy way to avoid this with CMake), we
need to override the generator value. We can switch the
default once our release infrastructure has been switched
to VS 2026.

Change-Id: I8a17d452e9e5690a5507d17129286142df6c88f1
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1711
Message-Id: <20260609152123.27460-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37139.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agoGHA: Maintenance update June 2026
Frank Lichtenheld [Tue, 9 Jun 2026 15:20:57 +0000 (17:20 +0200)] 
GHA: Maintenance update June 2026

Contains the following renovate updates:
- chore(deps): update github actions
- chore(deps): update vcpkg digest to 75672db
- chore(deps): update dependency aws/aws-lc to v5
- chore(deps): update dependency libressl/portable to v4.3.2

Change-Id: I11fc104878ba244c5be04ce8019695b6892c4457
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1710
Message-Id: <20260609152103.27418-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37138.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agorenovate: Fix typo in regex manager
Frank Lichtenheld [Tue, 9 Jun 2026 15:20:38 +0000 (17:20 +0200)] 
renovate: Fix typo in regex manager

Broken since commit 8485518dce6b7ebeda6295fcdf3bc7476b7b9117
("GHA: Factor out building SSL libs to a reusable workflow")

Change-Id: I668b96afae9dda5692c46db14634b3b8c03056e5
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1709
Message-Id: <20260609152045.27384-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37137.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agoNull-terminate tls-crypt client keys when testing
Max Fillinger [Tue, 9 Jun 2026 10:24:01 +0000 (12:24 +0200)] 
Null-terminate tls-crypt client keys when testing

After generating a tls-crypt-v2 client key, OpenVPN will try to load the
generated key to verify that it was generated correctly. If the client
key is not written to disk but printed out on the command line, the PEM
encoded key is stored in memory and read_pem_key_file is called with
key_file_inline = true. However, this key is not a null-terminated
string, so we end up calling strlen on a buffer that isn't
null-terminated.

This commit adds a null-byte at the end of the key.

Change-Id: I2ca8bf90a796f2b757c2fde0ae24468ef3abc3b5
Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1701
Message-Id: <20260609102407.32590-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37116.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agomudp: send HMAC reset reply synchronously
Antonio Quartulli [Tue, 9 Jun 2026 07:54:07 +0000 (09:54 +0200)] 
mudp: send HMAC reset reply synchronously

Building a HARD_RESET reply was queueing the result into three
multi_context fields and deferring the send to the next event-loop
iteration, where multi_process_outgoing_link() flushed it:

  struct buffer hmac_reply;
  struct link_socket_actual *hmac_reply_dest;  /* aliased &m->top.c2.from */
  struct link_socket *hmac_reply_ls;

The mechanism had three latent issues:

1. hmac_reply_dest = &m->top.c2.from stored a pointer alias into
   shared mutable state.  Any subsequent read into m->top.c2.from
   silently retargeted the pending reply to a different peer.
2. m->hmac_reply_ls = sock; at the top of multi_get_create_instance_udp()
   was executed unconditionally for every UDP packet, including packets
   that did not queue a reply.  A stale queued reply could thus be sent
   on the wrong listening socket.
3. hmac_reply.data pointed into m->top.c2.buffers->aux_buf (the only
   slot).  A second send_hmac_reset_packet() before the first flush
   would overwrite the first reply's bytes.

These were latent on master because m->multi_io->udp_flags was consumed
and zeroed by the first event in each multi_io_process_io() loop, so at
most one UDP read ran per outer iteration.

Send the reply synchronously from within send_hmac_reset_packet() using
the sock that the read fired on (threaded through do_pre_decrypt_check).
The reply is small, stateless, and rate-limited by the existing
reflect_filter_rate_limit_check(); dropping on EAGAIN is acceptable
because the client retransmits its HARD_RESET.  The three multi_context
fields and the deferred-flush block in multi_process_outgoing_link() are
gone; p2mp_iow_flags() no longer needs an IOW_TO_LINK branch for hmac
state.

Change-Id: I2df0fec786184b9fcf9b7c56c74816325cdb6942
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1702
Message-Id: <20260609075413.17380-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37117.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agoFix: port-share and multi-socket interaction
Gianmarco De Gregori [Wed, 20 May 2026 10:11:44 +0000 (12:11 +0200)] 
Fix: port-share and multi-socket interaction

When port-share is used, enforce the presence
of a TCP listener by checking the local_list
entries insted of rely on the global
connection_entry proto field.

Github: fixes OpenVPN/openvpn#1027

Change-Id: Id4e21efebbe64b963cf7847ad77bc41339af7a37
Signed-off-by: Gianmarco De Gregori <gianmarco@mandelbit.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1680
Message-Id: <20260520101152.17453-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36986.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agodev-tools: Fix run-cppcheck to cover more code
Frank Lichtenheld [Sun, 7 Jun 2026 17:07:07 +0000 (19:07 +0200)] 
dev-tools: Fix run-cppcheck to cover more code

Massively improve how we call cppcheck to cover
more code and identify more issues.

When specifying any -D argument all other defines
are ignored unless --force or --max-configs is
specified as well. I mistakenly assumed that this
was covered by --check-level=exhaustive. We need
to try finding a value for --max-configs so that
cppcheck doesn't spend hours scanning options.c

Add a library cfg for our code which for now
- identifies some printf-style functions
- adds some common macro defines

Use existing libraries.

Add a second call to cppcheck to separate the
Windows and Unixy code scans. This avoids some
very non-sensical define combinations.

Change-Id: I05720ccc3bcf706bbe62254afb74562580f5de56
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1665
Message-Id: <20260607170713.4980-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37078.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agoEnsure pushed tun-mtu is no lower than TUN_MTU_MIN
Arne Schwabe [Fri, 5 Jun 2026 18:09:25 +0000 (20:09 +0200)] 
Ensure pushed tun-mtu is no lower than TUN_MTU_MIN

The normal path ensure that the minimum tun mtu is set to at least
TUN_MTU_MIN. However, the pushed options path does not have this
restriction.

Check that the tun-mtu is within the limits of min/max mtu
in options.c. This ensure that the check is also correctly done
on the pushed variant.

Also add an extra check to keep the allowed payload for icmp6 packets
to be at least 64 bytes in the the block-ipv6 code path
(ipv6_send_icmp_unreachable) as extra layer of defence.

Pushing a low mtu like 1 and also block-ipv6 could trigger an
assertion in the ipv6_send_icmp_unreachable code path.

Reported-By: Haiyang Huang <huanghaiyang83@gmail.com>
Change-Id: Iff8b336126a5dff9871213664b1e8585fb70d21e
Signed-off-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Acked-by: MaxF <max@max-fillinger.net>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1707
Message-Id: <20260605180931.3547-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37069.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agodco_linux: allow passing KEEPALIVE_TIMEOUT without KEEPALIVE_INTERVAL
Marco Baffo [Fri, 5 Jun 2026 18:10:46 +0000 (20:10 +0200)] 
dco_linux: allow passing KEEPALIVE_TIMEOUT without KEEPALIVE_INTERVAL

Depends on: https://github.com/OpenVPN/ovpn-net-next/commit/67f453e3146a646ef5f811e5a85c610537d80521

Closes: https://github.com/OpenVPN/openvpn/issues/911
Change-Id: Ib56fb53ec1c0c30c9aecbd0ca440de2affad04b5
Signed-off-by: Marco Baffo <marco@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1705
Message-Id: <20260605181053.3774-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37070.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
6 weeks agosocket: assert buffer length before reading prepended sockaddr family
Lev Stipakov [Fri, 5 Jun 2026 14:18:02 +0000 (16:18 +0200)] 
socket: assert buffer length before reading prepended sockaddr family

read_sockaddr_from_packet() inspected sa->sa_family before any check
on buf->len, so a short delivery from the dco-win driver would have
produced a garbage peer address from uninitialized buffer memory.
The driver always prepends a full sockaddr and validates the family
before writing, so reaching any of the size/family checks would mean
something is severely wrong on the driver side - assert the three
preconditions instead of M_FATAL'ing on them.

GitHub: https://github.com/OpenVPN/openvpn-private-issues/issues/105

Change-Id: I2ce954aa5b74002be5e38d53783435736625bb2f
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1706
Message-Id: <20260605141808.14028-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37065.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoopenvpnserv: always use W variant of RpcStringFree()
Frank Lichtenheld [Thu, 14 May 2026 09:19:12 +0000 (11:19 +0200)] 
openvpnserv: always use W variant of RpcStringFree()

Probably not a real issue since it should always use the
W version in our case, but still unclean.

Fixes a cppcheck complaint.

Change-Id: I3d391016dcd3c66e58f3f05b356bcd419224acb1
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Heiko Hund <heiko@openvpn.net>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1671
Message-Id: <20260514091918.18197-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36915.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoopenvpnserv: Fix memory leak when loading DLLs
Frank Lichtenheld [Thu, 14 May 2026 09:15:06 +0000 (11:15 +0200)] 
openvpnserv: Fix memory leak when loading DLLs

Identified by cppcheck.

Change-Id: Iad3f0c36ac3795fa6a13f2d63bd00ad9c2c30d48
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Heiko Hund <heiko@openvpn.net>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1670
Message-Id: <20260514091512.17662-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36913.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agobuffer: Fix some issues with -DVERIFY_ALIGNMENT
Frank Lichtenheld [Wed, 13 May 2026 09:22:45 +0000 (11:22 +0200)] 
buffer: Fix some issues with -DVERIFY_ALIGNMENT

- Fix some uninitalised fields due to BUF_INIT_TRACKING
  (found by cppcheck and the original reason for this
   change).
- Fix "unused functions" if only BUF_INIT_TRACKING is
  defined.
- Fix conversion error

Change-Id: I3ecb76d9022dcd7dae92eb5e9d62e5f018744883
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1666
Message-Id: <20260513092251.28857-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36901.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoopenvpnserv: Address some uninitVariable warnings from cppcheck
Frank Lichtenheld [Wed, 13 May 2026 15:08:57 +0000 (17:08 +0200)] 
openvpnserv: Address some uninitVariable warnings from cppcheck

In the first case this is about helping cppcheck
remember that msg->addr_len and addr_len are the same
thing, but we use them in confusing ways.

In the second case there is indeed a theoretical
code path where we use an uninitialized buffer. So
make the code safer.

Change-Id: Ida6d4fa8c5c5ffbd7909d6afd51b1b6f32ca2d9f
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Heiko Hund <heiko@openvpn.net>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1674
Message-Id: <20260513150902.27447-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36908.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoDo not use deprecated aliases on Windows
Frank Lichtenheld [Wed, 13 May 2026 15:08:32 +0000 (17:08 +0200)] 
Do not use deprecated aliases on Windows

Both these work perfectly fine but are discouraged
and might cause warnings by compilers.

Identified by cppcheck.

Change-Id: I04e35928244e6ecda8c58285a812516662b50742
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Heiko Hund <heiko@openvpn.net>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1673
Message-Id: <20260513150838.27382-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36909.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agomulti: Remove useless checks
Frank Lichtenheld [Wed, 13 May 2026 09:17:05 +0000 (11:17 +0200)] 
multi: Remove useless checks

If mi is NULL, the previous code lines already
segfaulted.

Identified by cppcheck.

Change-Id: If58bb807842b7b95aeffe6849e7a7344e4925762
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1667
Message-Id: <20260513091710.28378-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36899.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agopool: Fix a potential NULL pointer de-reference in test code
Frank Lichtenheld [Fri, 8 May 2026 15:31:51 +0000 (17:31 +0200)] 
pool: Fix a potential NULL pointer de-reference in test code

Identified by cppcheck. Probably has been a long time
since that code has been compiled, though.

Change-Id: I09ebbf6f3555dd68ce8d75bfa844ecac518a0cf2
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1676
Message-Id: <20260508153156.13575-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36865.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoroute: Clarify operator precedence in a & b ? c : d
Frank Lichtenheld [Mon, 11 May 2026 20:06:39 +0000 (22:06 +0200)] 
route: Clarify operator precedence in a & b ? c : d

As suggested by cppcheck.

Change-Id: I5c9b54dca0a14688a3bb7798cb086f5bde7311b8
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1668
Message-Id: <20260511200645.24711-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36880.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agotun: Remove one useless if check
Frank Lichtenheld [Fri, 8 May 2026 15:34:53 +0000 (17:34 +0200)] 
tun: Remove one useless if check

The condition was already checked in an outer if check.

Identified by cppcheck.

Change-Id: I0aeb4583707a80592ec2577fbb060f7fbcb73e48
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1677
Message-Id: <20260508153458.13848-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36867.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoFix some msg() calls with wrong number of arguments in Windows-only code
Frank Lichtenheld [Fri, 8 May 2026 15:31:02 +0000 (17:31 +0200)] 
Fix some msg() calls with wrong number of arguments in Windows-only code

For some reason neither MSVC nor MinGW complained?
cppcheck did (once told that msg is a printf-style
function).

Change-Id: Ia688ec12e642de699811ced8668b40be9fbb6155
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1672
Message-Id: <20260508153108.13488-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36862.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agodco_freebsd: Add check_malloc_return after realloc
Frank Lichtenheld [Thu, 7 May 2026 07:53:15 +0000 (09:53 +0200)] 
dco_freebsd: Add check_malloc_return after realloc

cppcheck complained about a potential memleak
due to realloc failure. But trying to handle that
is probably not useful. Just abort like we do
for other malloc failures.

Change-Id: Icd8ea093dfe9f1888570f3d7b786b951b5262e47
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1669
Message-Id: <20260507075321.25123-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36842.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agosample: Fix cppcheck error invalidPrintfArgType_sint
Frank Lichtenheld [Thu, 7 May 2026 07:54:56 +0000 (09:54 +0200)] 
sample: Fix cppcheck error invalidPrintfArgType_sint

Change-Id: Ia7ad24181bd97dccbb77865c10e829778f72a506
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1662
Message-Id: <20260507075502.25473-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36844.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoDNS server documentation update
Selva Nair [Thu, 30 Apr 2026 16:32:43 +0000 (18:32 +0200)] 
DNS server documentation update

Github: OpenVPN/openvpn#937

Change-Id: I53b3f4c60897a1f4dd5efeb6575d525ffb082402
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1646
Message-Id: <20260430163249.13638-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36816.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agot_client.sh: Do not use CA_CERT variable as indicator for good .rc file
Frank Lichtenheld [Wed, 6 May 2026 14:59:28 +0000 (16:59 +0200)] 
t_client.sh: Do not use CA_CERT variable as indicator for good .rc file

t_client.sh doesn't actually care about this variable, and our
.rc files do not use it anymore. If you really want to dynamically
skip running t_client.sh just set TEST_RUN_LIST to empty in the .rc
file.

Change-Id: I7cf7146c3c4f1a01b0bcb57e03d09b32f8b59780
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1664
Message-Id: <20260506145933.22301-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36827.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agodns-scripts: Fix dnssec values in comments and Copyright statement format
Frank Lichtenheld [Thu, 30 Apr 2026 13:03:48 +0000 (15:03 +0200)] 
dns-scripts: Fix dnssec values in comments and Copyright statement format

- Fix the example value of dnssec to an actual valid one
- Fix the formatting of the Copyright statements to be
  consistent with all other files in the project

Change-Id: Id6832e3f56420debc8b19d0144d53ca41abb678b
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1645
Message-Id: <20260430130354.25337-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36800.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agodns: minimalist fix for dnssec setting
Selva Nair [Thu, 30 Apr 2026 12:40:14 +0000 (14:40 +0200)] 
dns: minimalist fix for dnssec setting

Github: fixes OpenVPN/openvpn#1024

Change-Id: I0cb093e0116e92d874162d51be777aa43674c115
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1644
Message-Id: <20260430124020.23066-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36797.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoGHA: Add caching for vcpkg builds
Frank Lichtenheld [Wed, 29 Apr 2026 09:39:33 +0000 (11:39 +0200)] 
GHA: Add caching for vcpkg builds

The nice automatic caching was removed last year,
so go back to manual caching of the binary cache
dir.

While here, also update vcpkg to latest master.

Change-Id: I933227aa4bc4f05b58d0e754b4330da807504d01
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Yuriy Darnobyt <yura.uddr@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1642
Message-Id: <20260429093938.23601-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36775.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoGHA: Maintenance Update April 2026
Frank Lichtenheld [Wed, 29 Apr 2026 09:39:51 +0000 (11:39 +0200)] 
GHA: Maintenance Update April 2026

- Updates GHA actions
- Switch clang-format job to archive: false supported
  in new actions/upload-artifact version. This way the
  file is not encapsulated in a zip
- Drop macos-14 builds. This runner is considered
  deprecated and will be removed later this year.

Change-Id: I43851d96c28af0ebcf0c6beab21659e68919d0c6
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Yuriy Darnobyt <yura.uddr@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1641
Message-Id: <20260429093957.23705-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36776.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoFix pkgcs11 vcpkg port installing debug files on release builds
Luis Cruz [Tue, 28 Apr 2026 12:48:04 +0000 (14:48 +0200)] 
Fix pkgcs11 vcpkg port installing debug files on release builds

Change-Id: Icfa559d9923d7dacb4b72e47b22688a4225c4708
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1640
Message-Id: <20260428124810.29709-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36762.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoconfigure: Remove --enable-strict
Frank Lichtenheld [Mon, 27 Apr 2026 17:47:50 +0000 (19:47 +0200)] 
configure: Remove --enable-strict

Both -Wsign-compare (via -Wextra) and -Wuninitalized (via
-Wall) are enabled by default. So this does not do anything
anymore.

While here also remove rest of --enable-strict-options which
was mostly removed in commit
2104ea62430e4d203f2cd998e053f4192798b9f1

Change-Id: I53e7b984980cb1e2b3f68e80358b61c9e1045725
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1590
Message-Id: <20260427174757.4075-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36752.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoMbed TLS: Error out if we have no valid tls-groups
Max Fillinger [Tue, 21 Apr 2026 05:53:50 +0000 (07:53 +0200)] 
Mbed TLS: Error out if we have no valid tls-groups

Previously, when no valid groups were specified with the tls-groups
option, the Mbed TLS build of OpenVPN would start up and run, but fail
to complete a handshake, while the OpenSSL build would exit with an
error. This commit changes the behavior of the Mbed TLS build to match
the OpenSSL version.

Change-Id: Ica5f37e525c3812609021750ecd3986c1420e2a4
Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1633
Message-Id: <20260421055357.21708-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36699.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2 months agoFixup: prompting password from management
Selva Nair [Fri, 24 Apr 2026 16:18:33 +0000 (18:18 +0200)] 
Fixup: prompting password from management

Commit b450414 added logic for reading password from management
when not in file or inline, but it was made conditional on
`response_from_stdin` which is always true! Fix by explicitly
checking for `password_from_stdin`.

Github: fixes OpenVPN/openvpn#1021

Change-Id: I4d46c3672691b159cbd98a17020c4f30782bc202
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1638
Message-Id: <20260424161840.5767-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36739.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoEnsure that buffer of freed session are not used
Arne Schwabe [Fri, 10 Apr 2026 14:59:53 +0000 (16:59 +0200)] 
Ensure that buffer of freed session are not used

In a race condition an old TLS session could still try to send a packet but
also get replaced by a new session. In this case, the buffer of the new
session is still referenced. Add the check_session_buf_not_used function
to mitigate this problem.

Also make the check if the to_link pointer is in one of the memory
regions a bit better even though this not make a difference with the
way we use these structs. But better safe than sorry.

A better solution to remove the TM_INITIAL state and handle reconnecting
session in their own complete tls_multi is a more involved fix that requires
a lot more refactoring.

CVE: 2026-40215
Reported-By: XlabAI Team of Tencent Xuanwu Lab (xlabai@tencent.com)
Reported-By: Guannan Wang (wgnbuaa@gmail.com
Reported-By: Zhanpeng Liu (pkugenuine@gmail.com)
Reported-By: Guancheng Li (lgcpku@gmail.com)
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Change-Id: I7c5fa2a7a2563b7a8955d386411f3ceffe5b092f
Private-URL: https://github.com/OpenVPN/openvpn-private-issues/issues/112
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agotls-crypt-v2: Avoid interpreting opcode as part of WKc
Steffan Karger [Sun, 12 Apr 2026 11:37:56 +0000 (13:37 +0200)] 
tls-crypt-v2: Avoid interpreting opcode as part of WKc

The buffer we pass to tls_crypt_v2_extract_client_key contains the
entire received control channel packet. We should skip the opcode before
trying to read WKC.

This logic error is a second bug behind the XlabAI finding, next too the
too-strict ASSERT in tls_crypt_unwrap.

Also remove a too strict ASSERT in tls_crypt_unwrap.  We already check
a few lines later for a too short packet and return a proper error
("packet too short").

XlabAI found a way of triggering this ASSERT that requires a tls-crypt-v2
client key that has a specific property (a specific byte need to have a
specific value, about 1/256 probability). If an attacker can get hold of
such a tls-crypt-v2 client key or observe a handshake using such a key,
the attacker can trigger the ASSERT, crashing the server. Setups that do
not use tls-crypt-v2 are not affected.

Independently, Cisco Talos reported a way to trigger this ASSERT with any
tls-crypt-v2 key but this requires the attacker to be also in possession
of the private key part of the tls-crypt-v2 client key or to inject packet
into a live session of a client session.

CVE: 2026-35058
Reported-By: XlabAI Team of Tencent Xuanwu Lab (xlabai@tencent.com)
Reported-By: Guannan Wang (wgnbuaa@gmail.com
Reported-By: Zhanpeng Liu (pkugenuine@gmail.com)
Reported-By: Guancheng Li (lgcpku@gmail.com)
Reported-By: Emma Reuter of Cisco ASIG (TALOS-2026-2381)
Signed-off-by: Steffan Karger <steffan@karger.me>
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Change-Id: I623733c0476c98f436d19009ee8990693c1579b5
Private-URL: https://github.com/OpenVPN/openvpn-private-issues/issues/111
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agodev-tools: Add script to run cppcheck against the code-base
Frank Lichtenheld [Sun, 19 Apr 2026 13:41:57 +0000 (15:41 +0200)] 
dev-tools: Add script to run cppcheck against the code-base

Also add a suitable suppressions-list file to
make it possible to run it without reporting
errors.

Tested with cppcheck 2.19.0 (Ubuntu 26.04).

Change-Id: I125cf63f11257d7245ead2f7feafb86b841580a5
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1620
Message-Id: <20260419134205.21459-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36664.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoFix copyright line in README
Gert Doering [Mon, 20 Apr 2026 17:47:29 +0000 (19:47 +0200)] 
Fix copyright line in README

2022->2026

Github: OpenVPN/openvpn#1012
Change-Id: Ie838a5491089cc6b11970aee313a18ba52fc4856
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Yuriy Darnobyt <yura.uddr@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1629
Message-Id: <20260420174735.18824-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36696.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoGHA: Factor out building SSL libs to a reusable workflow
Frank Lichtenheld [Mon, 20 Apr 2026 16:07:27 +0000 (18:07 +0200)] 
GHA: Factor out building SSL libs to a reusable workflow

We amassed a lot of code duplication there. Make
it easier to track the differences between the libraries.

Change-Id: I3d89016ccae297cfa596897c11a518f1ffbe3dc8
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Yuriy Darnobyt <yura.uddr@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1630
Message-Id: <20260420160732.9492-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36686.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agodns: Change arguments to setenv_dns_option to avoid sign-compare warning
Frank Lichtenheld [Tue, 7 Apr 2026 09:46:37 +0000 (11:46 +0200)] 
dns: Change arguments to setenv_dns_option to avoid sign-compare warning

The change is a bit big to fix just one compare warning,
but that is due to the highly interdependent code.

Change-Id: Ibfcc350c772227cfc0f2244fa2b1625dcb7e6fb5
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1558
Message-Id: <20260407094643.28090-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36531.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoRemove various redundant conditionals
Frank Lichtenheld [Sun, 19 Apr 2026 13:51:11 +0000 (15:51 +0200)] 
Remove various redundant conditionals

These are all already proven to be true by
surrounding code.

Identified by cppcheck.

Change-Id: Iacf06c113e8db5b7c78270f361ee76938ef1db47
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1613
Message-Id: <20260419135116.22170-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36666.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agotapctl: Remove unused function dont_mute
Frank Lichtenheld [Sun, 19 Apr 2026 13:39:41 +0000 (15:39 +0200)] 
tapctl: Remove unused function dont_mute

Identified by cppcheck.

Change-Id: I87c40dc94035345add1162e5029e51288811cb09
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1615
Message-Id: <20260419133947.21215-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36662.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoInlined credentials: read missing password from management interface
Selva Nair [Tue, 14 Apr 2026 05:58:54 +0000 (07:58 +0200)] 
Inlined credentials: read missing password from management interface

When commit 39619b7fab added support for inlining username only,
fallback for password was from console. This is not ideal when
graphical UI is in use as there is no console. Instead, query the
management interface when possible.

This patch just extends a similar fix when username is read from
a file and password is missing. As before, any username read
from file or inlined is not peserved as we currently have no way
of locking the username in the management interface prompt.

Change-Id: Ieeb2f980330d485739dbf3d722f107c1dbf704fc
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1599
Message-Id: <20260414055900.17132-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36608.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoverify_x509_name: Improve the error message on failure
Selva Nair [Tue, 14 Apr 2026 05:58:24 +0000 (07:58 +0200)] 
verify_x509_name: Improve the error message on failure

Print the actual string that was used for the match instead of the
whole subject.

Github: closes OpenVPN/openvpn#992

Change-Id: I6e7947ab81cf229f0d27714dd563a07ace6bd38a
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1624
Message-Id: <20260414055830.17032-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36606.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoGHA: Add OpenSSL 4.0 build
Arne Schwabe [Fri, 17 Apr 2026 11:09:36 +0000 (13:09 +0200)] 
GHA: Add OpenSSL 4.0 build

Change-Id: Ic9c993cb8dcfedfd6f99f416c286e0968eb45255
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1601
Message-Id: <20260417110942.16538-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36648.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoOpenSSL 4.0: Use X509_check_certificate_times instead of X509_cmp_time
Arne Schwabe [Fri, 17 Apr 2026 16:46:38 +0000 (18:46 +0200)] 
OpenSSL 4.0: Use X509_check_certificate_times instead of X509_cmp_time

The X509_cmp_time function is deprecated in OpenSSL 4.0. So we avoid it and
use the new API.

Change-Id: I6c2eda0e5bbb3a70b404f821e25ded81f0f5ddd5
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1595
Message-Id: <20260417164644.17897-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36651.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agossl_openssl: Fix some CRL mixups
David Benjamin [Thu, 16 Apr 2026 17:41:35 +0000 (19:41 +0200)] 
ssl_openssl: Fix some CRL mixups

There are two ways to load CRLs in OpenSSL. They can be loaded at the
X509_STORE, shared across verifications, or loaded per verification at
the X509_STORE_CTX.

OpenVPN currently does the former. However, it also supports CRL
reloading, and tries to reload the CRL file before each connection.
OpenSSL does not really have a good way to unload objects from an
X509_STORE. OpenVPN currently does it by grabbing the
STACK_OF(X509_OBJECT) out of the X509_STORE and manually deleting all
the CRLs from it.

This mutates an OpenSSL internal object which bumps into problems if
OpenSSL ever switches to a more efficient representation. See
https://github.com/openssl/openssl/pull/28599

(It's also not thread-safe, though it doesn't look like that impacts
OpenVPN? Actually even reading that list doesn't work. See
CVE-2024-0397. This OpenSSL API was simply broken.)

Additionally, this seems to cause two OpenVPN features to not work
together. I gather backend_tls_ctx_reload_crl is trying to clear the
CRLs loaded from last time it ran. But tls_ctx_load_ca with a ca_file
can also load CRLs. tls_ctx_load_ca with ca_path will also pick up CRLs
and backend_tls_ctx_reload_crl actually ends up clobbering some state
X509_LOOKUP_hash_dir internally maintains on the X509_STORE. Likewise,
tls_verify_crl_missing can get confused between
backend_tls_ctx_reload_crl's crl_file-based CRLs and CRLs from
tls_ctx_load_ca.

Avoid all this by tracking the two CRLs separately. crl_file-based CRLs
now go onto a STACK_OF(X509_CRL) tracked on the tls_root_ctx. Now this
field can be freely reloaded by OpenVPN without reconfiguring OpenSSL.
Instead, pass the current value into OpenSSL at verification time.  To
do so, we need to use the SSL_CTX_set_cert_verify_callback, which allows
swapping out the X509_verify_cert call, and also tweaking the
X509_STORE_CTX configuration before starting certificate verification.

Context: SSL_CTX_set_cert_verify_callback and the existing
verify_callback are not the same. SSL_CTX_set_cert_verify_callback wraps
the verification while verify_callback is called multiple times
throughout verification. It's too late to reconfigure X509_STORE_CTX in
verify_callback. verify_callback is usually not what you want.
Sometimes current_cert and error_depth don't quite line up, and
cert_hash_remember may end up called multiple times for a single
certificate.

I suspect some of the other verify_callback logic would also be better
done in the new callback, but I've left it alone to keep this change
minimal. verify_callback is really only usable for suppressing errors.
Application bookkeeping is better down elsewhere.

Add .clang-format section for STACK_OF since we otherwise format the
line as STACK_OF(X509_CRL) * crls

Github: see also openssl/openssl#28599
Signed-off-by: David Benjamin <davidben@google.com>
Change-Id: I31ac2a763209114267c35c4a9182a12d8d82f6fe
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Acked-by: MaxF <max@max-fillinger.net>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1289
Message-Id: <20260416174142.28918-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36641.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoAdd unit tests for 'auth-user-pass username-only'
Selva Nair [Tue, 14 Apr 2026 05:57:59 +0000 (07:57 +0200)] 
Add unit tests for 'auth-user-pass username-only'

Input from stdin is tested.

Change-Id: I1c18b3cf4a454444a61941d88a702a140b0ac23d
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1602
Message-Id: <20260414055805.16974-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36605.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoAdd ARIA ciphersuite IANA name translations
Dorian Harmans [Tue, 14 Apr 2026 14:22:09 +0000 (16:22 +0200)] 
Add ARIA ciphersuite IANA name translations

Signed-off-by: Dorian Harmans <me@dorianharmans.nl>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20260414142209.584424-1-me@dorianharmans.nl>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36613.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agossl_mbedtls: Fix format string in get_ssl_library_version
Frank Lichtenheld [Tue, 14 Apr 2026 05:59:21 +0000 (07:59 +0200)] 
ssl_mbedtls: Fix format string in get_ssl_library_version

These are unsigned values, so treat them as such.

Identified by cppcheck.

Change-Id: I232fba91cfcca6c35d37696bc86890a366f5967f
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1626
Message-Id: <20260414055927.17252-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36607.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agobuild: Use info fetched from version.m4
Luis Cruz [Tue, 14 Apr 2026 12:56:37 +0000 (14:56 +0200)] 
build: Use info fetched from version.m4

Change-Id: I3157e1a228ac7058fca6a88f94076052e33d2e01
Signed-off-by: Luis Cruz <luis.cruz@nordsec.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1605
Message-Id: <20260414125637.42082-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36612.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoLog when writing username/password to TLS buffer fails
Selva Nair [Tue, 14 Apr 2026 05:57:14 +0000 (07:57 +0200)] 
Log when writing username/password to TLS buffer fails

Currently we get an unhelpful "Key Method #2 failed" error.
Add a more specific warning message.

Change-Id: I9468811fd434e17645957fc12770aa2b9ed98fb8
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1600
Message-Id: <20260414055721.16857-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36604.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoChange type of max_clients to uint32_t
Frank Lichtenheld [Tue, 7 Apr 2026 11:24:28 +0000 (13:24 +0200)] 
Change type of max_clients to uint32_t

peer_id is mostly this already (except in DCO
context for some reason), and max_peerid was
defined as uint32_t as well. So changing max_clients
to uint32_t avoids many -Wsign-compare warnings.

While here fix limit for max_clients in options
parsing. It is not allowed to be MAX_PEER_ID
exactly.

Change-Id: I8d6b7bc1b7744dc6d57aaed3231b8901275752f2
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1564
Message-Id: <20260407112434.5588-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36535.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agonetworking_sitnl: Make sitnl_parse_rtattr* return void
Frank Lichtenheld [Wed, 8 Apr 2026 20:42:07 +0000 (22:42 +0200)] 
networking_sitnl: Make sitnl_parse_rtattr* return void

It returned a constant value so it didn't actually
do anything.

Identified by cppcheck.

Change-Id: Idfe2afd9616e17f0f80a914ff054ae18f0b6972b
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Antonio Quartulli <antonio@mandelbit.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1614
Message-Id: <20260408204213.9892-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36559.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoOptimise iterating over all clients by remembering highest peer id
Arne Schwabe [Sun, 12 Apr 2026 12:53:50 +0000 (14:53 +0200)] 
Optimise iterating over all clients by remembering highest peer id

This keeps track of the highest peer id that is currently allocated to avoid
iterating over the empty tail of the m->instances array.

Change-Id: If797f3fe178fba3f43fb12898e5484bfb38f05c3
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1557
Message-Id: <20260412125356.32261-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36577.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoRemove multi_context->iter
Arne Schwabe [Fri, 13 Mar 2026 10:49:55 +0000 (11:49 +0100)] 
Remove multi_context->iter

The multi_context->iter is basically a hash with only one bucket. This makes
m->iter a linear list. Instead of maintaining this extra list use
m->instances instead. This is a fixed sized continuous array, so iterating
over it should be very quick. When the number of connected clients
approaches max_clients, iterating over a static array should be faster than
a linked list, especially when considering cache locality.

Of the several places where m->iter is used only one is potentially on a
critical path: the usage of m->iter in multi_bcast.

However this performance difference would be only visible with a lightly
loaded server with very few clients. And even in this scenario I could
not manage to measure a difference.

Change-Id: Ibf8865e451866e1fffc8dbc8ad5ecf6bc5577ce4
Signed-off-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1556
Message-Id: <20260313104955.16748-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36087.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoTry to emphasise the transition from old ovpn-dco to new ovpn module
Arne Schwabe [Sat, 11 Apr 2026 09:06:18 +0000 (11:06 +0200)] 
Try to emphasise the transition from old ovpn-dco to new ovpn module

This tries to ensure that the difference between the old and new module
is clearer.

Also removed a duplicate section about --disable-dco from the manual page.

This also changes one instance of ovpn-dco to ovpn that is probably a bug
when reusing a tun device.

Change-Id: Iff9f6811fdf553f59f2afee0072d7bf90133d328
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Antonio Quartulli <antonio@mandelbit.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1550
Message-Id: <20260411090625.18343-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36573.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoClarify operator precedence in a & b ? c : d
Frank Lichtenheld [Tue, 7 Apr 2026 20:52:28 +0000 (22:52 +0200)] 
Clarify operator precedence in a & b ? c : d

As suggested by cppcheck.

Change-Id: Ia153e0de888c0ee21199b192f3471ce4c08cb5c7
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1619
Message-Id: <20260407205235.31126-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36545.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agoopenvpnserv: Remove redundant bit-wise operation
Frank Lichtenheld [Tue, 7 Apr 2026 20:53:36 +0000 (22:53 +0200)] 
openvpnserv: Remove redundant bit-wise operation

Found by cppcheck.

Change-Id: I7f983168c263e49da7665fc20bd1ecdd426c21d0
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1623
Message-Id: <20260407205344.31263-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36547.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agotest_buffer: Add test for buf_null_terminate
Frank Lichtenheld [Tue, 7 Apr 2026 09:50:38 +0000 (11:50 +0200)] 
test_buffer: Add test for buf_null_terminate

Change-Id: I01683153a68e1809a4d7ab455eb346f53780e219
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1580
Message-Id: <20260407095044.28528-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36532.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agomanagement: add base64 multi-line input for passwords
Luca Boccassi [Mon, 30 Mar 2026 18:08:54 +0000 (20:08 +0200)] 
management: add base64 multi-line input for passwords

Allow management clients to send long passwords via the
usual multi-line base64 encoded protocol.

A client declares MCV 5 support and sends a 'password <type>'
line, followed by as many lines (each up to 1024 bytes) as
needed, in base64 encoded format, terminated by 'END'.

This is useful when a password is a JIT-generated use-once
token.

Declare management version 6 for this feature.

Change-Id: Ib99f171fb69d51f2260b44edf8ebe21ac958f233
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Acked-by: Selva Nair <selva.nair@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1593
Message-Id: <20260330180900.16608-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36360.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agopush: Make prepare_push_reply return void
Frank Lichtenheld [Mon, 6 Apr 2026 07:26:11 +0000 (09:26 +0200)] 
push: Make prepare_push_reply return void

It returned a constant value so it didn't actually
mean anything.

While here also make it static.

Identified by cppcheck.

Change-Id: Ied966413948cf3c935a8a1eb91172ef7a6948bdd
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1616
Message-Id: <20260406072617.27790-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36514.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agotest_packet_id: Add a check after malloc to ensure value is valid
Frank Lichtenheld [Mon, 6 Apr 2026 07:47:24 +0000 (09:47 +0200)] 
test_packet_id: Add a check after malloc to ensure value is valid

cppcheck complains about a potential null pointer dereference
in reliable_get_num_output_sequenced_available. That is mostly
theoretical, but still add a check.

Change-Id: I64da2328591ef2b9ee7502e574c878651cdf356a
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1621
Message-Id: <20260406074729.29903-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36516.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agowin: Fix nrpt_dnssec flag handling
Frank Lichtenheld [Sun, 5 Apr 2026 10:22:04 +0000 (12:22 +0200)] 
win: Fix nrpt_dnssec flag handling

By default the first enum value is 0.
But we check whether we set the flag by doing
BOOL dnssec = (msg->flags & nrpt_dnssec) != 0;
This can't ever be true.

Found by cppcheck.

Change-Id: Iff5be978817bfc0cd4d78818e7be7b90bad71f3c
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1606
Message-Id: <20260405102209.31528-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36487.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agocrypto_backend: Remove md_full
Frank Lichtenheld [Sun, 5 Apr 2026 10:31:04 +0000 (12:31 +0200)] 
crypto_backend: Remove md_full

There was only one user for mbedtls < 4.0,
so remove all the unused implementations.

Identified by cppcheck.

Change-Id: Ie2285f5bf52f5c669fb01f9ae36d6aa1674f0929
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1612
Message-Id: <20260405103110.32401-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36495.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
3 months agomtcp: Remove noop statement in multi_tcp_process_outgoing_link_ready
Frank Lichtenheld [Sat, 4 Apr 2026 20:33:30 +0000 (22:33 +0200)] 
mtcp: Remove noop statement in multi_tcp_process_outgoing_link_ready

Assigning to a parameter here has no effect. I can see no
obvious alternative statement that might have been intended.

Found by cppcheck.

Change-Id: I04a01cf536ee6d48d54ba623dda460c4a98859f9
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1609
Message-Id: <20260404203335.30650-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36478.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>