90 Commits

Author SHA1 Message Date
Florian Eckert
2255c65fa1 openvpn: make the packages dependency clearer
No functional changes, so the PKG_RELEASE version number has not been
incremented.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-04-15 11:08:30 +02:00
Qingfang Deng
9faf26770b openvpn: update to 2.7.1
The new DCO module depends on OpenVPN 2.7.1.
For details refer to https://github.com/OpenVPN/openvpn/blob/v2.7.1/Changes.rst

Removed upstreamed wolfSSL patches:
- 101-Fix-EVP_PKEY_CTX_-compilation-with-wolfSSL.patch
- 102-Disable-external-ec-key-support-when-building-with-wolfSSL.patch

Reworked 100-mbedtls-disable-runtime-version-check.patch to use
MBEDTLS_VERSION_STRING instead of a mutable buffer.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
2026-04-13 19:24:25 +03:00
Chen Minqiang
bd524c0a7a openvpn: fix quoting and deprecated option filtering
This patch fixes two issues in the netifd protocol script:

1. Fix logic error in deprecated option filtering:
   Previously, ${f%%:*} was called before checking for the deprecated
   flag (:d). This stripped the suffix and made the check [ "${f#*:}" = "d" ]
   always fail. The cleaning of $f is now deferred until after this check.

2. Improve parameter quoting for specific options:
   - Adds single quotes to --push and --push-remove parameters to handle
     spaces (e.g., "route 10.0.0.0 255.255.255.0").
   - Unifies quoting for 'file' type options to improve shell safety.
   - Refactors the build logic using a case statement for better
     extensibility.

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2026-03-27 14:56:22 +01:00
Chen Minqiang
cde9e3b668 openvpn: increment PKG_RELEASE by one
Increment PKG_RELEASE by one.

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2026-03-21 15:47:47 +02:00
Chen Minqiang
29e74f34d3 openvpn: handle netifd setup in hotplug script
- Process 'up'/'down' events to manage interface status.
- Add IPv4/IPv6 addresses and routes via netifd-proto.
- Parse DNS/search domains from foreign options.
- Convert netmasks and CIDR strings with new helpers.
- Apply MTU settings from OpenVPN environment.

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2026-03-21 15:47:47 +02:00
Chen Minqiang
bda60d1fc5 openvpn: cleanup and fix netifd proto script logic
- Default to '--ifconfig-noexec' and '--route-noexec' to allow hotplug
  script to handle IP and routing configuration.
- Only append '--auth-user-pass-verify' if the option is explicitly
  configured to avoid unexpected authentication requirements.
- Fix missing retrieval of 'auth_user_pass', 'askpass', and 'tls_verify'.
- Remove redundant '--config' parameter (managed by option_builder).
- Simplify 'script_security' assignment logic.

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2026-03-21 15:47:47 +02:00
Sander van Deijck
e0ab7d0dfa openvpn: update to 2.6.19
Update the openvpn package to the latest version in
the 2.6.x branch while development of the 2.7.x branch
become stable enough to merge.

Signed-off-by: Sander van Deijck <sander@vandeijck.com>
2026-03-18 12:14:11 +02:00
Hannu Nyman
eb85b30011 openvpn: increment PKG_RELEASE by one
Increment PKG_RELEASE by one.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2026-03-15 09:28:52 +02:00
Paul Donald
56453de58c openvpn: change tmp-dir to /tmp
This allows openvpn to create any temp files after
user or group change at exec time.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
ef3ffde899 openvpn: change file/path types
move file and path type values to FILE type params
so they are better handled with quoting, in case
paths contain spaces.

Remove duplicate 'extra_certs'.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
dc8198b960 openvpn: proto handler; write params to config file
writing the command line to a config file avoids
formatting pitfalls for the command line.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
ea5daeae16 openvpn: proto handler; trim white-space from append
'append' inserts white-space by default (3rd parameter)

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
00471e0dc9 openvpn: shell proto script improvements
add mode server hook scripts hotplug handling

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
0d39f4ec8b openvpn: ucode hotplug script improvements
add mode server hook scripts hotplug handling

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
99a24f515a openvpn: hotplug script improvements
add mode server hook scripts hotplug handling

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
c0faf0714d openvpn: ucode proto script improvements
fix the pop() bug
write options to a config file in case argv length > 63

netifd has a hard limit of 64 argv entries for its ucode
proto.run_command whereby '--param' is one, and its
'option string' is two.

follow-up to affa96dc81

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
e8ae8b1a8f openvpn: sync with proto shell-script
add hotplug script handlers to ucode version

follow-up to 647b67e18b

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
ddb20d9880 openvpn: proto handler; handle user config file
Handle a user provided config file.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
08bc5a7e90 openvpn: shellcheck fixes
correct spacing for [] if blocks and var quoting.
use json_get_vars to get user-defined scripts so the
setenv parameters are appended to the command line.

handle ovpnproto as a PROTO_STRING so it is monitored
and loaded.

follow-up to 337a449c03
and 647b67e18b

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Paul Donald
4ecd407766 openvpn: handling for 'push' and other array options
remove duplicate 'push' entry from string types.
push and other array values shall be "double quoted".
we also must 'eval' so that the double-quoted array values
don't get split on spaces.
Also quote file paths in case they contain spaces.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-15 08:45:36 +02:00
Florian Eckert
19bf94887b openvpn: increment PKG_RELEASE by one
Increment PKG_RELEASE by one.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-11 14:22:41 +01:00
Florian Eckert
647b67e18b openvpn: add hotplug handling back in
This commit adds hotplug handling back in.

Fixes: 2607b761 ("openvpn: introduce proto handler")

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-11 14:22:41 +01:00
Florian Eckert
337a449c03 openvpn: use append for the remaining options
There is already the 'append' command, which assembles all parameters that
are called 'proto_run_command'. Let´s move also the last params to the
top. To ensure that the sequence is correct, the parameters must be added
at the beginning, so that user parameters can overwrite them.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-11 14:22:41 +01:00
Florian Eckert
be20045045 openvpn: use also append for dev_type and ovpnproto options
There is already the 'append' command, which assembles all parameters that
are called 'proto_run_command'. Let´s use that. To ensure that the
sequence is correct, the parameters must be added at the beginning, so that
user parameters can overwrite them.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-11 14:22:41 +01:00
Florian Eckert
f89b656de2 openvpn: use common pattern for global variable
The common pattern for global variable is, to write the variable name in
capital letters. This improves maintainability in shell scripts.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-11 14:22:41 +01:00
Florian Eckert
9ccb8650fd openvpn: fix auth_user_pass option
The variable 'auth_file' is not used in the following programm sequence.
It therefore only makes sense to add it as a call parameter via 'append'
when calling the the 'proto_run_commmand'.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-11 14:22:41 +01:00
Florian Eckert
a5b3ecfbcf openvpn: rename openvpn proto option to ovpnproto option
This was forgotten during renameing of this option.

Fixes: e026ce0f ("openvpn: handle ovpnproto exclusively")

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-11 14:22:41 +01:00
Florian Eckert
54eae83c95 openvpn: remove net needed blank lines
There is always only one blank line between the sections.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-11 14:22:41 +01:00
Florian Eckert
803e8ae3f7 openvpn: increment PKG_RELEASE by one
Increment PKG_RELEASE by one.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-05 07:54:01 +01:00
Florian Eckert
8816657223 openvpn: move usr/share/openvpn files into its own dir
By moving the file to a subdirectory, it is easier to track where the file
is located on the target without having to check the Makefile every time.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-05 07:54:01 +01:00
Florian Eckert
310c097378 openvpn: move lib/upgrade/keep.d file into its own dir
By moving the file to a subdirectory, it is easier to track where the file
is located on the target without having to check the Makefile every time.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-05 07:54:01 +01:00
Florian Eckert
f1c2f51fc8 openvpn: improve readability for files install target
Each script to be installed is moved to its own line to improve readability.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-05 07:54:01 +01:00
Florian Eckert
9d2de51e06 openvpn: remove not needed INSTALL_DIR creations
This 'INSTALL_DIR' creation are not needed anymore after refactoring.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-05 07:54:01 +01:00
Florian Eckert
27df3c8341 openvpn: refactoring INSTALL_DIR command call during install
Move the 'INSTALL_DIR' creation in the make install target to the location
where the files are also installed. This prevents directories that are no
longer needed from being forgotten during refactoring.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2026-03-05 07:54:01 +01:00
Paul Donald
e026ce0f01 openvpn: handle ovpnproto exclusively
Since proto was migrated to ovpnproto to avoid collision
with netifd proto, this shall be handled separately.

Also avoid using uci commands to migrate the config which
requires knowing property types; use awk instead.

follow-up to 2607b76154

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2026-03-03 17:23:53 +02:00
Paul Donald
6b054c6cef openvpn: drop unused eurephia
This plugin has not seen updates to keep it synchronised
with recent openvpn, nor any updates in the last several
years. It relies on the SHA1 algo which is deprecated,
and iptables. ovpn has its own management interface.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
https://github.com/openwrt/packages/pull/28533
2026-02-22 11:54:13 +02:00
Paul Donald
90d5a8ce35 openvpn: enable management interface
This eases management of live servers via its socket
interface.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
https://github.com/openwrt/packages/pull/28533
2026-02-22 11:54:13 +02:00
Paul Donald
0ff7aa62fc openvpn: disable compression in builds
If you need the security risks of using compression,
make a custom build.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
https://github.com/openwrt/packages/pull/28533
2026-02-22 11:54:13 +02:00
Paul Donald
affa96dc81 openvpn: introduce ucode proto handler
In preparation for netifd support for ucode
proto handlers.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
https://github.com/openwrt/packages/pull/28533
2026-02-22 11:54:13 +02:00
Paul Donald
2607b76154 openvpn: introduce proto handler
openvpn needs a proto handler. Here it is.

Removed all of the up/down scripts from the init handler
and made those entirely optional (with some ucode examples).

The config options have been updated to reflect v 2.6/2.7,
with a 'd' flag to denote deprecated. Deprecated flags are
gated behind an 'allow_deprecated' config flag, which must
be on to use them. Some flags will cease to work in the next
version.

Users should not be using compression. Openvpn has enough
security holes and pitfalls already without using
compression.

Updated the example configs (left in place as legacy
documentation) and removed older cryptos which do not exist
in ovpn any longer.

A migration script is included -x. /etc/config/openvpn
entries become interface entries in /etc/config/network
with proto='openvpn'. The source config is retained.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
https://github.com/openwrt/packages/pull/28533
2026-02-22 11:54:13 +02:00
Martin Schiller
390cdc1419 openvpn: add missing options
Add missing options taken from the OpenVPN 2.6 manual.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2025-12-23 10:47:44 -03:00
Martin Schiller
789cf82890 openvpn: remove vanished options
These options are no longer available in openvpn 2.6.x.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2025-12-23 10:47:44 -03:00
Ben Kibbey
10ac81b9aa openvpn: add peer-fingerprint support
This lets the --peer-fingerprint openvpn option be parsed which requires
a client TLS certificate fingerprint (colon separated SHA256 hash) to
match one specified in the option argument, during authentication.

Signed-off-by: Ben Kibbey <bjk@luxsci.net>
2025-10-02 18:24:09 -03:00
Wesley Gimenes
7c88f998e5 openvpn: bump PKG_RELEASE
Although recent updates were made, the `PKG_RELEASE` bump was missed.

Signed-off-by: Wesley Gimenes <wehagy@proton.me>
2025-09-29 04:44:04 -03:00
Dennis Camera
01fafd69ef openvpn: remove kmod-ovpn-dco-v2 dependency
OpenVPN does work without the kernel module, it just won't be able to use DCO.
To make life easier for OpenVPN users on very space-constrained devices make it
an optional dependency.

Signed-off-by: Dennis Camera <dennis.camera+openwrt@riiengineering.ch>
2025-06-18 15:31:14 +02:00
Dennis Camera
11e17a3ed6 openvpn: enable DCO by default
Enable the DCO option by default in the openvpn package to allow for
better performance and have a use case for kmod-ovpn-dco-v2 :-)

Signed-off-by: Dennis Camera <dennis.camera+openwrt@riiengineering.ch>
2025-06-18 15:31:14 +02:00
Ivan Pavlov
74a66189f1 openvpn: update to 2.6.14
Security fixes:

​CVE-2025-2704: fix possible ASSERT() on OpenVPN servers using --tls-crypt-v2
 Security scope: OpenVPN servers between 2.6.1 and 2.6.13 using --tls-crypt-v2 can be made
 to abort with an ASSERT() message by sending a particular combination of authenticated and
 malformed packets. No crypto integrity is violated, no data is leaked, and no remote code
 execution is possible. This bug does not affect OpenVPN clients.

For details refer to https://github.com/OpenVPN/openvpn/blob/v2.6.14/Changes.rst

Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
2025-04-04 14:41:46 +02:00
Ivan Pavlov
def5214e2c openvpn: update to 2.6.13
Feature changes:
 - on non-windows clients (MacOS, Linux, Unix) send "release" string from uname() call as IV_PLAT_VER to server
 - Windows: protect cached username, password and token in client memory
 - Windows: use new API to get dco-win driver version from driver
 - Linux: pass --timeout=0 argument to systemd-ask-password, to avoid default timeout of 90 seconds

Security fixes:
 - improve server-side handling of clients sending usernames or passwords longer than USER_PASS_LEN

Notable bug fixes:
 - FreeBSD DCO: fix memory leaks in nvlist handling
 - purge proxy authentication credentials from memory after use

For details refer to https://github.com/OpenVPN/openvpn/blob/v2.6.13/Changes.rst

Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
2025-01-16 10:27:34 -08:00
Ivan Pavlov
909825835b openvpn: update to 2.6.12
This is a bugfix release

Bug fixes:

 - the fix for CVE-2024-5594 (refuse control channel messages with nonprintable characters) was too strict, breaking user configurations
   with AUTH_FAIL messages having trailing CR/NL characters. This often happens if the AUTH_FAIL reason is set by a script.

 - Http-proxy: fix bug preventing proxy credentials caching

For details refer to https://github.com/OpenVPN/openvpn/blob/v2.6.12/Changes.rst

Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
2024-07-21 05:54:34 -07:00
Clemens Hopfer
1cf592503b openvpn: fix startup with script-security lower than 2
External scripts may only be specified with script-security 2 or higher,
otherwise OpenVPN fails at tunnel startup with an error.
This changes the previously hardcoded hotplug scripts to only be added if
script-security is 2 or higher is used.

Signed-off-by: Clemens Hopfer <openwrt@wireloss.net>
2024-07-03 12:55:24 -07:00