Skip to content

OpenVPN: Port Connection implementation to Zig#523

Merged
keeshux merged 36 commits into
masterfrom
feature/openvpn-connection
Jul 25, 2026
Merged

OpenVPN: Port Connection implementation to Zig#523
keeshux merged 36 commits into
masterfrom
feature/openvpn-connection

Conversation

@keeshux

@keeshux keeshux commented Jul 24, 2026

Copy link
Copy Markdown
Member

First pass. Port Swift functionality without delving too much into simplifications, except for a few key ones:

  • Let daemon looper follow the connection's lifecycle instead of the daemon's lifecycle. This diverges from Swift where the looper lived inside the OpenVPNSession.
  • Assume that connections only live within a daemon, never standalone. In other words: always require an explicit serialized_executor, no races as long as it's used to run generic code.
  • Omit NetworkMonitor from connection sandbox; reachability and better path events are posted directly.
  • Split daemon and connection events for different semantics

Specific to OpenVPN:

  • Advertise IV_MTU
  • Restore parser parity plus a few fixes/improvements (data ciphers, *-client socket types)

General cleanups:

  • Centralize crypto backends and port tests (tests require at least one backend)
  • Fold Swift reachability and better path runtime events into a single NetworkMonitor object based on NWPathMonitor
  • Make cache profile-scoped
  • Reuse stored allocators for deinit
  • Link to vendor binaries

Logging in particular will be refactored in another PR.

@keeshux keeshux added this to the Rewrite in Zig milestone Jul 24, 2026
@keeshux keeshux self-assigned this Jul 24, 2026
@keeshux keeshux added enhancement New feature or request OpenVPN labels Jul 24, 2026
@keeshux
keeshux marked this pull request as draft July 24, 2026 12:54
keeshux added 6 commits July 24, 2026 19:27
- Move CryptoBackend and fnt to C module
- Use default crypto backend in parser if available
- Validate complete configuration on import
- Fix parsing order of data ciphers
- Parse digest case-insensitive
- Accept all *-client socket types
- Reject inline auth-user-pass
@keeshux
keeshux marked this pull request as ready for review July 24, 2026 23:39
Comment thread zig/src/wireguard/connection.zig Outdated
Comment thread zig/src/wireguard/resolver.zig
Comment thread zig/src/wireguard/adapter.zig
Comment thread zig/src/wireguard/adapter.zig Outdated
Comment thread zig/src/openvpn/internal/logging.zig
Comment thread zig/src/openvpn/internal/session_context.zig
Comment thread zig/src/openvpn/internal/settings.zig
Comment thread zig/src/net/looper.zig
Comment thread zig/src/net/connection.zig
Comment thread zig/src/net/connection.zig
@keeshux keeshux added the refactoring Reworks the software architecture label Jul 25, 2026
@keeshux
keeshux merged commit 33e03f9 into master Jul 25, 2026
2 checks passed
@keeshux
keeshux deleted the feature/openvpn-connection branch July 25, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request OpenVPN refactoring Reworks the software architecture

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant