aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/Shared/Model (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update repo urlsJason A. Donenfeld2019-12-301-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* WgQuickConfig: Swift treats \r\n as a single characterJason A. Donenfeld2019-06-281-1/+1
| | | | | | | | | | | | | | | | let blah = "hello\nworld\ndoes\nthis\nwork" print(blah.split(separator: "\n")) //output: ["hello", "world", "does", "this", "work"] let blah2 = "hello\r\nworld\r\ndoes\r\nthis\r\nwork" print(blah2.split(separator: "\n")) //output: ["hello\r\nworld\r\ndoes\r\nthis\r\nwork"] //expected: ["hello\r", "world\r", "does\r", "this\r", "work\r"] In blah2, the string splitting fails because swift considers \r\n to be its own character. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelsManager: store UID on macOS for keychain availabilityJason A. Donenfeld2019-06-111-6/+23
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Swift 5 migration: Handle changes in Data's pointer interfaceRoopesh Chander2019-04-091-6/+32
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Swift 5 migration: Fix switch warningsRoopesh Chander2019-04-091-0/+6
| | | | | | | | | | We now get a warning when switching over enums from system frameworks even when we handle all public cases because there can be future cases that aren't handled. When such a future case is introduced, we'll get a warning. Signed-off-by: Roopesh Chander <roop@roopc.net>
* macOS: Better handling of tunnels created by another userRoopesh Chander2019-04-031-3/+3
| | | | | | Previously, the tunnels just got deleted. Signed-off-by: Roopesh Chander <roop@roopc.net>
* wg-quick parser: trim \r as wellJason A. Donenfeld2019-03-111-5/+5
| | | | | | | | The influx of Windows users has already begun to infect our nice project. Reported-by: Cosku Bas <cosku.bas@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Log migration of tunnel configurationRoopesh Chander2019-02-121-0/+1
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Don't migrate in asTunnelConfiguration()Roopesh Chander2019-02-121-11/+8
| | | | | | | | It causes problems when installing a tunnel through a Configuration Profile on macOS and activating it first through Network Preferences. Signed-off-by: Roopesh Chander <roop@roopc.net>
* Fix writing of preshared key to config formatRoopesh Chander2019-02-091-1/+1
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Global: fix swiftlint issuesJason A. Donenfeld2019-02-081-3/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* KeyEncoding: rename file to match extension filename styleJason A. Donenfeld2019-02-081-0/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Key: we already do len checking in CJason A. Donenfeld2019-02-081-6/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Key: Use C implementation insteadJason A. Donenfeld2019-02-083-111/+159
| | | | | | | Swift compiles so slowly and it's unclear all of the insane type punning was even correct. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Key: Constant time encodingJason A. Donenfeld2019-02-082-7/+159
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* PrivateDataConfirmation: prompt with touch/face/pin/password ID for viewing/exporting keysJason A. Donenfeld2019-02-061-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* LegacyConfig: Remove and support plaintext for .mobileconfigJason A. Donenfeld2019-02-062-205/+13
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Keychain: store configurations in keychain instead of providerConfigJason A. Donenfeld2019-02-062-21/+49
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick conf parser: Handle inline comments correctlyRoopesh Chander2019-02-051-3/+3
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Config file parsing: Fix bug when there are comments at the endRoopesh Chander2019-01-241-28/+28
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Tunnel: support getting runtime configurationJason A. Donenfeld2019-01-242-0/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Parsing: Always error on unrecognized keysRoopesh Chander2019-01-141-12/+10
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Parsing: Error on duplicate entriesRoopesh Chander2019-01-141-2/+7
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* macOS: Refactor config file parsingRoopesh Chander2019-01-141-26/+71
| | | | | | | - To report more fine grained errors - To make the parse errors conform to WireGuardAppError Signed-off-by: Roopesh Chander <roop@roopc.net>
* Update copyrightJason A. Donenfeld2019-01-0710-10/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Don't set username on NETunnelProviderProtocolRoopesh Chander2018-12-221-3/+0
| | | | | | | | The username corresponds to the Account field in iOS system VPN UI, but if we don't set it, the field is not shown, so setting it isn't really required. Signed-off-by: Roopesh Chander <roop@roopc.net>
* All models now EquatableEric Kuck2018-12-216-0/+75
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Localize remaining strings in network extensionJason A. Donenfeld2018-12-221-0/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Move model helpers to model directoryJason A. Donenfeld2018-12-224-0/+463
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Move name from interface to tunnelJason A. Donenfeld2018-12-222-5/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Nuke trailing spacesJason A. Donenfeld2018-12-215-11/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* providerConfiguration is now a WgQuickConfigEric Kuck2018-12-216-162/+2
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* All migration stuff moved to one gross fileEric Kuck2018-12-216-235/+0
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Updated NETunnelProvider save formatEric Kuck2018-12-2113-169/+494
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Remove non-helpful commentsRoopesh Chander2018-12-193-6/+0
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Most similar views now shared between ViewControllersEric Kuck2018-12-141-1/+1
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* More formatting nits and cyclomatic complexity fixesEric Kuck2018-12-122-6/+4
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Tons more swiftlint warnings fixed. Still a few remaining.Eric Kuck2018-12-121-7/+7
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Added swiftlint and fixed all errors (and a bunch, but not all, warnings)Eric Kuck2018-12-124-16/+24
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Model: Declare keyLength constant and use that wherever applicableRoopesh Chander2018-12-091-3/+6
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model, Tunnels manager: Rewrite the model for VPN-on-demandRoopesh Chander2018-11-122-87/+1
| | | | | | | | | The VPN-on-demand settings should not be part of the tunnel configuration. Rather, the onDemandRules stored in the tunnel provider configuration serve as the one place where the VPN-on-demand settings are stored. Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model: Add activationType to tunnel configurationRoopesh Chander2018-11-112-18/+24
| | | | | | | | | We make sure existing tunnel serializations can be deserialized correctly. We also bump up the tunnelConfigurationVersion, because the tunnel configuration contents have changed. Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model: ActivityType enum to represent VPN-on-demand optionsRoopesh Chander2018-11-101-0/+66
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model: TunnelConfiguration: Add explicit conformance to DecodableRoopesh Chander2018-11-101-1/+15
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model: Ensure that a TunnelConfiguration always has a valid array of peersRoopesh Chander2018-11-101-2/+9
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model: Endpoint.hostname()Roopesh Chander2018-11-081-0/+11
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model: Move InterfaceConfiguration.publicKey to Curve25519.swiftRoopesh Chander2018-11-081-4/+0
| | | | | | The code for public key calculation need not be shared with the extension Signed-off-by: Roopesh Chander <roop@roopc.net>
* Move logic to extension: Move model files to SharedRoopesh Chander2018-11-084-0/+287
Signed-off-by: Roopesh Chander <roop@roopc.net>