summaryrefslogtreecommitdiffhomepage
path: root/talpid-wireguard/src/lib.rs
AgeCommit message (Collapse)AuthorFilesLines
2025-10-29Make the DAITA overhead log more compactSebastian Holmin1-23/+14
2025-10-24Add padding packet over log on disconnectSebastian Holmin1-2/+34
2025-10-24Propagate error if configuring GotaTun device in invalid stateMarkus Pettersson1-0/+5
2025-10-24Integrate GotaTun cleanlyMarkus Pettersson1-37/+53
Refactor `trait Tunnel` and factor `start_daita` into `set_config`. Co-authored-by: Joakim Hulthe <joakim.hulthe@mullvad.net>
2025-10-08Block tunnel traffic when negotiating with an ephemeral peer on AndroidMarkus Pettersson1-0/+1
Patch tunnel config to block traffic to non-gateway destinations during PQ setup when using Boringtun on Android. Move `patch_allowed_ips` to `config` module.
2025-09-18Add multiplexer POC to daemon, TSM, and relay selectorDavid Lönnhager1-1/+7
2025-08-21Set QUIC MTU based on route onlyDavid Lönnhager1-55/+69
2025-08-18Set clamped MTU for obfuscationDavid Lönnhager1-6/+9
2025-08-18Update QUIC MTU valueDavid Lönnhager1-0/+6
2025-07-25Do not set per-route MTU for boringtunDavid Lönnhager1-9/+27
2025-07-10Run `cargo fmt`Sebastian Holmin1-3/+3
2025-07-09Fix returning the result of a `let` bindingSebastian Holmin1-4/+2
2025-05-26Add BoringtunJoakim Hulthe1-182/+178
Co-authored-by: Joakim Hulthe <joakim.hulthe@mullvad.net> Co-authored-by: Sebastian Holmin <sebastian.holmin@mullvad.net> Co-authored-by: David Göransson <david.goransson@mullvad.net> Co-authored-by: Markus Pettersson <markus.pettersson@mullvad.net> Co-authored-by: David Lönnhager <david.l@mullvad.net>
2025-05-14Add some comments to talpid-wireguardJoakim Hulthe1-0/+5
2025-03-21Use regular default route for the tunnel interface on WindowsDavid Lönnhager1-22/+1
This replaces the /1 routes for two reasons: 1. This mitigates an issue in our fork of wireguard-nt, which intentionally allows routes back to the tunnel interface. The fork explicitly disallows this only for routes with a prefix 0, which means that the /1 routes are not exempted. This can result in an infinite routing loop if the non-tunnel route to the relay is removed (e.g., if the default interface or its routes disappear). 2. This simplifies the code and routes. The /1 routes are unnecessary since we're setting the metric on the default route and interface to the lowest value anyway, so the OS should always prefer the tunnel default route. Even if it doesn't, the firewall will prevent leaks.
2025-02-25Reduce open_tun calls (Establish)David Göransson1-10/+8
Each call to Establish opens a window for leaks on android. By only invoking Establish if the VpnConfig if any of the input has changed and reusing it otherwise we avoid many of these leaks. This commit also waits for android to report back that the routes have been created to ping and verify connectivity to avoid pings going outside the tunnel.
2025-02-06Replace old waitForTunnelUp functionDavid Göransson1-1/+7
After invoking VpnService.establish() we will get a tunnel file descriptor that corresponds to the interface that was created. However, this has no guarantee of the routing table beeing up to date, and we might thus send traffic outside the tunnel. Previously this was done through looking at the tunFd to see that traffic is sent to verify that the routing table has changed. If no traffic is seen some traffic is induced to a random IP address to ensure traffic can be seen. This new implementation is slower but won't risk sending UDP traffic to a random public address at the internet.
2025-01-27Do bikesheddingSebastian Holmin1-41/+19
2025-01-27Refactor error message for LinuxSebastian Holmin1-23/+12
2025-01-27Split into a fn per platformSebastian Holmin1-100/+107
2025-01-27Refactor wireguard implementation pickerSebastian Holmin1-62/+87
2025-01-24Make start_tunnel async on WindowsDavid Lönnhager1-5/+3
2025-01-24Support `FORCE_USERSPACE_WIREGUARD` on windowsSebastian Holmin1-3/+3
2025-01-24Remove more use of `#[cfg(daita)]`Markus Pettersson1-2/+0
2025-01-24Format codeDavid Lönnhager1-10/+12
2025-01-24Handle network changes for wireguard-go (rebind endpoint socket)David Lönnhager1-3/+5
2025-01-24Enable DAITA v2 for Windows via wireguard-goDavid Lönnhager1-15/+13
2025-01-24Build wireguard-go via wireguard-go-rs on WindowsDavid Lönnhager1-0/+17
2025-01-23Refactor connectivity check to be asyncDavid Lönnhager1-110/+88
2025-01-14Add route to obfuscator if necessaryMarkus Pettersson1-1/+1
2025-01-07Fix bug where `block_on` was called from an async contextMarkus Pettersson1-4/+22
2024-12-20Remove unwrapSebastian Holmin1-1/+2
2024-12-20Add `log_tunnel_data_usage` to Android tooSebastian Holmin1-3/+11
2024-12-20Add logging for ephemeral peer negotiation timeouts on WindowsSebastian Holmin1-2/+29
2024-12-20Revert `force_wireguard_handshake` because it was brokenMarkus Pettersson1-2/+0
2024-12-18Force WireGuard handshake before PQ handshakeDavid Lönnhager1-0/+2
2024-12-12Use dynamic DAITA machines in wireguard-goDavid Lönnhager1-13/+8
Co-authored-by: Markus Pettersson <markus.pettersson@mullvad.net>
2024-12-02Replace generic with new typeSebastian Holmin1-39/+35
2024-12-02Replace dyn fn with genericSebastian Holmin1-25/+20
2024-12-02Make tunnel connection errors recoverableKalle Lindström1-9/+0
2024-11-22Check that that tunnel can serve traffic after starting a new tunnelKalle Lindström1-67/+60
- Split up "ConnectivityCheck" into more descriptive types and collect them in a new `connectivity` module. - Fix allow Wireguard-Go tunnel setup to be cancelled - Use retry param in connectivity check
2024-11-22Fix a lot of thingsMarkus Pettersson1-55/+35
- Fix remaining rustc warnings on non-Android platforms - Fix lookup entry peer if it exists in wireguard-go - Fix talpid-wireguard not compiling on windows - Fix entry peer config code - Fix clippy issue - Fix Daita - Remove TODOs
2024-11-22Add multihop negotiation with ephemeral peersKalle Lindström1-23/+51
Use `WgGoTunnel` directly on Android because a specialized implemenation of `set_config` has to be used.
2024-11-22Split up platform specific `start_tunnel` functionsMarkus Pettersson1-0/+28
2024-10-24Fix endpoint addr routeDavid Lönnhager1-2/+2
2024-10-23Do not adjust MTU at all if user has overridden itDavid Lönnhager1-6/+12
2024-10-23Move MTU adjustment into talpid-wireguardDavid Lönnhager1-4/+85
2024-10-21Take obfuscation overhead into account when setting MTUJoakim Hulthe1-1/+8
2024-10-17Fix obfuscation not being applied properly on tunnel creationDavid Göransson1-9/+10
2024-09-24Move ephemeral negotiation to own moduleDavid Lönnhager1-200/+4