Commit Graph

1046 Commits

Author SHA1 Message Date
Davide De Rosa a3c991a25f Update a few things about license
- Copyright in LICENSE

- Note about custom licenses in README
2022-09-30 21:28:27 +02:00
Davide De Rosa a5ad04a0a6 Upgrade OpenSSL to 1.1.1q 2022-09-30 21:28:27 +02:00
Davide De Rosa 5c84c15416 Use localOptions to clarify context
localOptions = cfg.configuration
2022-09-25 17:23:13 +02:00
Davide De Rosa 6018c30cc4 Add fallback for compression algorithm 2022-09-23 23:01:57 +02:00
Davide De Rosa ca378c4999
[ci skip] Set release date 2022-09-23 19:51:37 +00:00
Davide De Rosa 64b3fa47af Add some missing documentation 2022-09-23 21:45:04 +02:00
Davide De Rosa 000fde0aa2 Update CHANGELOG 2022-09-23 16:16:48 +02:00
Davide De Rosa 6dc1140d5b Revert "Work around segfault in Xcode 13.3 "Release""
This reverts commit 02e702d97b.
2022-09-23 16:11:37 +02:00
Davide De Rosa 0db3f52931 Add methods to remove WireGuard default gateways 2022-09-14 22:07:46 +02:00
Davide De Rosa e2aaffc06f Reconnect with current manager and configuration 2022-08-05 07:38:53 +02:00
Davide De Rosa 36ed23ccc4 Bump to OpenSSL 1.1.1o 2022-06-17 10:06:03 +02:00
Davide De Rosa 83a2842214 Customize app extension log path
Store path into App Group. Do not read it from UserDefaults in
app extension because value is immediately available in provider
configuration.
2022-06-17 09:19:54 +02:00
Davide De Rosa 4eb9a92c2e Hide setters of shared provider defaults
Tunnel values were overwritable by app.

Instead:

- Write from app extension with "private" setter (_appexSet*)

- Read from app with public getter
2022-06-17 09:18:28 +02:00
Davide De Rosa 178dda56ac Simplify .configureLogging() in app extensions 2022-06-17 09:16:41 +02:00
Davide De Rosa 61227fcb35 Bump CI to macOS 12 2022-05-17 18:06:51 +02:00
Davide De Rosa 6e0471a55b Report vpnIsEnabled = false on install error 2022-04-27 15:44:40 +02:00
Davide De Rosa e075ba6a76 Make DNS servers optional in DoT like in DoH
Domain name can actually by an IP address and not require a DNS
server to resolve.
2022-04-25 21:46:16 +02:00
Davide De Rosa 469523cac5 Fix badges/requirements as per package targets 2022-04-16 10:40:18 +02:00
Davide De Rosa f0a5557cfb Fix previous commit further (my bad) 2022-04-13 22:55:43 +02:00
Davide De Rosa 07e94b2d5c Fix target name in import 2022-04-13 22:40:05 +02:00
Davide De Rosa 02e702d97b Work around segfault in Xcode 13.3 "Release"
Surely some Xcode bug. Doesn't like NSCAssert in inline function.
2022-04-12 21:18:03 +02:00
Davide De Rosa 7b72114893 Fix missing async in Demo 2022-04-12 20:49:21 +02:00
Davide De Rosa 6e7eab421e Bump 3rd party copyrights 2022-04-12 18:03:31 +02:00
Davide De Rosa f33a854943 Fix broken == on OpenVPN.Configuration
StaticKey was not comparing data by value.
2022-04-07 00:16:34 +02:00
Davide De Rosa 02d04185d3 Drop redundant Hashable implementation 2022-04-06 23:47:12 +02:00
Davide De Rosa e12e0b3051 Make VPN public methods async
- With Swift Concurrency
- Raise targets to iOS 13 / macOS 10.15
2022-04-06 11:18:06 +02:00
Davide De Rosa 990a0b85a6 Use WireGuardKit fork with platform fixes
- iPhone Simulator
- Catalyst
2022-04-06 09:31:33 +02:00
Davide De Rosa 46918a767a Adjust current SSID to also support Catalyst 2022-04-06 09:31:33 +02:00
Davide De Rosa 521c1fd79d Mention golang requirement for WireGuard 2022-04-06 09:31:33 +02:00
Davide De Rosa 6b54fd6124 Move Fallback into Configuration 2022-04-06 09:31:32 +02:00
Davide De Rosa f046bcd629 Add options to explicitly enable/disable DNS/proxy
DNS/proxy settings, when missing from configuration, fall back to
whatever the server pushes.

With isDNSEnabled/isProxyEnabled it's now possible to override this
behavior.
2022-03-26 17:22:45 +01:00
Davide De Rosa 4bfa0b4e74 Make sure MTU is positive 2022-03-26 17:08:45 +01:00
Davide De Rosa bbdc21fd61 Fix a few things in demo
- OpenVPN: Set default gateway
- WireGuard: "Connect" button not updated
2022-03-25 18:05:36 +01:00
Davide De Rosa 3bdff1ee8b Customize WireGuard debug log format 2022-03-25 18:02:39 +01:00
Davide De Rosa f1bdc8490c Use "struct" in data models to leverage Equatable
This way Configuration objects can be compared for changes.
2022-03-25 18:02:21 +01:00
Davide De Rosa f4508911aa Refine Keychain class
- Require context (kSecAttrService)

- Support userDefined parameter (kSecAttrGeneric)
2022-03-21 17:28:44 +01:00
Davide De Rosa 155d01005c Make Endpoint RawRepresentable
Can be convenient.
2022-03-18 18:40:58 +01:00
Davide De Rosa 69a00834cb Fix missing WireGuard dependency on SwiftyBeaver 2022-03-13 22:40:49 +01:00
Davide De Rosa 007c64f2b4 Add DataUnit entity 2022-03-13 22:35:57 +01:00
Davide De Rosa a7a7424257 Use WireGuardKit entities directly
No need to duplicate a well-written API.

- Offer convenience accessors in Configuration[Builder]
- Make Configuration init non-optional

Sanity checks are done in Builder with throws and decoded object
is always deemed valid.
2022-03-12 15:09:41 +01:00
Davide De Rosa ff235e2b96 Log OpenVPN tunnel via SwiftyBeaver file
This way debug log is updated without manual flush.

Useful for immediate access.
2022-03-12 10:35:39 +01:00
Davide De Rosa 3807b4754b Review some Core/OpenVPN entities
- Drop redundant Equatable (automatic in structs)
- Make IPv4/6 routes Hashable
- Expose StaticKey as hex String
- Mask PAC URL
2022-03-12 10:35:39 +01:00
Davide De Rosa 3741a17c20 Rewrite Manager package to make it stateless
In order to avoid chaos from multiple profiles, retain the
profile to be installed and remove all the other ones. Also,
make sure to do the removal AFTER install, as doing it
before would trigger the VPN permission alert again.

XXX: there is some weird behavior from NetworkExtension
occasionally sending notifications with a bogus NEVPNManager
object having a nil .localizedDescription and other properties set
to nonsensical values. Discard the notification when such an object
is identified.

Encapsulate extra NetworkExtension settings:

- passwordReference
- onDemandRules
- disconnectsOnSleep

Also:

- Only set on-demand if any rules are set
- Assume VPN is enabled even with on-demand disabled
- Use DataCount instead of raw Int pair

Attach useful information to VPN notifications:

- VPN isEnabled
- VPN status
- VPN command error
- Tunnel bundle identifier (if available)

Expose specific OpenVPN/WireGuard shared data via extensions in
UserDefaults/FileManager.

Finally, drop incomplete IKE support. No fit.
2022-03-12 10:35:39 +01:00
Davide De Rosa 133b4b2337 Replace hostname/endpointProtocols with remotes
Like official OpenVPN options.
2022-03-05 14:20:29 +01:00
Davide De Rosa 2bcd11fd7e Revisit WireGuard.Configuration
- Make Configuration Codable
- Expose WireGuard ConfigurationError
- Produce ConfigurationBuilder from Configuration
- Support multiple peers
- Make private key a requirement
2022-03-03 13:59:49 +01:00
Davide De Rosa c019cecbe0 Improve some things about OpenVPN.Configuration
- Treat empty passphrase as no passphrase
- Parse authentication requirement from --auth-user-pass
- Overload ConfigurationParser with String parameter
- Move OpenVPN fallbacks inline with builder

Give a withFallbacks: option to initialize basic fields rather
than leaving them nil.
2022-03-03 13:44:40 +01:00
Davide De Rosa 88544e4877
[ci skip] Set release date 2022-02-09 17:47:16 +00:00
Davide De Rosa 2646762bb4 [ci skip] Update copyright 2022-02-04 12:57:40 +01:00
Davide De Rosa 871e51517c Relax macOS target to 10.14
Requires updating OpenSSL package.
2022-02-02 23:24:29 +01:00
Davide De Rosa 1aa54d22fb Fix workflow syntax 2022-01-04 09:27:57 +01:00