Skip to content

Commit

Permalink
Merge branch 'release/0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ss-abramchuk committed Jun 27, 2021
2 parents efc584c + ab12dff commit 0e2db0b
Show file tree
Hide file tree
Showing 722 changed files with 30,356 additions and 8,554 deletions.
13 changes: 9 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# Changelog

## 0.8.0
- **Added**: Configuration properties to override tls-cipher and tls-ciphersuites.
- **Updated**: openvpn3 library to 3.6.1 version, ASIO library to 1.16.1 version.
- **Fixed**: Broken support ot the SPM.

## 0.7.0
- **Added**: An option to evaluate configuration without creating an instance of `OpenVPNAdapter`.
- **Updated**: Class `OpenVPNProperties` renamed to `OpenVPNConfigurationEvaluation`.
- **Updated**: openvpn3 library to 3.5.6 version, mbedTLS library to 2.7.13 version;
- **Updated**: openvpn3 library to 3.5.6 version, mbedTLS library to 2.7.13 version.

## 0.6.0
- **Updated**: Slightly changed API of the framework.
- **Fixed**: Reading packets issue affecting on connection when network interface is changed.
- **Fixed**: Reading packets issue affecting connection when network interface is changed.

## 0.5.0
- **Added**: Swift Package Manager support;
- **Updated**: openvpn3 library to 3.5.4 version;
- **Added**: Swift Package Manager support.
- **Updated**: openvpn3 library to 3.5.4 version.
- **Fixed**: Network issue when adapter used in macOS projects.
2 changes: 1 addition & 1 deletion OpenVPNAdapter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

s.name = "OpenVPNAdapter"
s.version = "0.7.0"
s.version = "0.8.0"
s.summary = "Objective-C wrapper for OpenVPN library. Compatible with iOS and macOS."
s.description = <<-DESC
OpenVPNAdapter is an Objective-C framework that allows to easily configure and establish VPN connection using OpenVPN protocol.
Expand Down
74 changes: 37 additions & 37 deletions OpenVPNAdapter.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To install OpenVPNAdapter with Cocoapods, add the following lines to your `Podfi
```ruby
target 'Your Target Name' do
use_frameworks!
pod 'OpenVPNAdapter', :git => 'https://github.com/ss-abramchuk/OpenVPNAdapter.git', :tag => '0.7.0'
pod 'OpenVPNAdapter', :git => 'https://github.com/ss-abramchuk/OpenVPNAdapter.git', :tag => '0.8.0'
end
```

Expand Down Expand Up @@ -160,7 +160,10 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
var startHandler: ((Error?) -> Void)?
var stopHandler: (() -> Void)?

override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) {
override func startTunnel(
options: [String : NSObject]?,
completionHandler: @escaping (Error?) -> Void
) {
// There are many ways to provide OpenVPN settings to the tunnel provider. For instance,
// you can use `options` argument of `startTunnel(options:completionHandler:)` method or get
// settings from `protocolConfiguration.providerConfiguration` property of `NEPacketTunnelProvider`
Expand Down Expand Up @@ -240,7 +243,10 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
vpnAdapter.connect(using: packetFlow)
}

override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) {
override func stopTunnel(
with reason: NEProviderStopReason,
completionHandler: @escaping () -> Void
) {
stopHandler = completionHandler

if vpnReachability.isTracking {
Expand All @@ -260,7 +266,11 @@ extension PacketTunnelProvider: OpenVPNAdapterDelegate {
// `OpenVPNAdapterPacketFlow` method signatures are similar to `NEPacketTunnelFlow` so
// you can just extend that class to adopt `OpenVPNAdapterPacketFlow` protocol and
// send `self.packetFlow` to `completionHandler` callback.
func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, configureTunnelWithNetworkSettings networkSettings: NEPacketTunnelNetworkSettings?, completionHandler: @escaping (Error?) -> Void) {
func openVPNAdapter(
_ openVPNAdapter: OpenVPNAdapter,
configureTunnelWithNetworkSettings networkSettings: NEPacketTunnelNetworkSettings?,
completionHandler: @escaping (Error?) -> Void
) {
// In order to direct all DNS queries first to the VPN DNS servers before the primary DNS servers
// send empty string to NEDNSSettings.matchDomains
networkSettings?.dnsSettings?.matchDomains = [""]
Expand All @@ -270,7 +280,11 @@ extension PacketTunnelProvider: OpenVPNAdapterDelegate {
}

// Process events returned by the OpenVPN library
func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, handleEvent event: OpenVPNAdapterEvent, message: String?) {
func openVPNAdapter(
_ openVPNAdapter: OpenVPNAdapter,
handleEvent event:
OpenVPNAdapterEvent, message: String?
) {
switch event {
case .connected:
if reasserting {
Expand Down Expand Up @@ -303,9 +317,8 @@ extension PacketTunnelProvider: OpenVPNAdapterDelegate {
// Handle errors thrown by the OpenVPN library
func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, handleError error: Error) {
// Handle only fatal errors
guard let fatal = (error as NSError).userInfo[OpenVPNAdapterErrorFatalKey] as? Bool, fatal == true else {
return
}
guard let fatal = (error as NSError).userInfo[OpenVPNAdapterErrorFatalKey] as? Bool,
fatal == true else { return }

if vpnReachability.isTracking {
vpnReachability.stopTracking()
Expand Down
48 changes: 43 additions & 5 deletions Scripts/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,51 @@

set -e

. functions.sh
function apply_patches()
{
DEP_SRC_DIR=$1
DEP_PATCH_DIR=$2

CURRENT_DIR=$(pwd)

ASIO_SRC_DIR="../Sources/ASIO"
ASIO_PATCH_DIR="../Sources/OpenVPN3/deps/asio/patches"
pushd ${CURRENT_DIR}

MBEDTLS_SRC_DIR="../Sources/mbedTLS"
MBEDTLS_PATCH_DIR="../Sources/OpenVPN3/deps/mbedtls/patches"
cd /tmp

for FILE in ${CURRENT_DIR}/${DEP_PATCH_DIR}/*.patch; do
echo Applying patch: $FILE
git apply --directory ${CURRENT_DIR}/${DEP_SRC_DIR} --unsafe-path $FILE
done

popd
}

function reverse_patches()
{
DEP_SRC_DIR=$1
DEP_PATCH_DIR=$2

CURRENT_DIR=$(pwd)

pushd ${CURRENT_DIR}

cd /tmp

REVERSED_PATCHES=$(ls -1 ${CURRENT_DIR}/${DEP_PATCH_DIR}/*.patch | sort -r)

for FILE in $REVERSED_PATCHES; do
echo Reverse patch: $FILE
git apply --reverse --directory ${CURRENT_DIR}/${DEP_SRC_DIR} --unsafe-path $FILE
done

popd
}

ASIO_SRC_DIR="Sources/ASIO"
ASIO_PATCH_DIR="Sources/OpenVPN3/deps/asio/patches"

MBEDTLS_SRC_DIR="Sources/mbedTLS"
MBEDTLS_PATCH_DIR="Sources/OpenVPN3/deps/mbedtls/patches"

if [ "$1" = "--reverse" ]; then
reverse_patches ${ASIO_SRC_DIR} ${ASIO_PATCH_DIR}
Expand Down
37 changes: 0 additions & 37 deletions Scripts/functions.sh

This file was deleted.

13 changes: 13 additions & 0 deletions Scripts/pull_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

OPENVPN3_VERSION="release/3.6.1"

git subtree pull --prefix Sources/OpenVPN3 git@github.com:OpenVPN/openvpn3.git ${OPENVPN3_VERSION} --squash

source Sources/OpenVPN3/deps/lib-versions

git subtree pull --prefix Sources/ASIO git@github.com:chriskohlhoff/asio.git ${ASIO_VERSION} --squash
git subtree pull --prefix Sources/LZ4 git@github.com:lz4/lz4.git ${LZ4_VERSION/lz4-/v} --squash
git subtree pull --prefix Sources/mbedTLS git@github.com:ARMmbed/mbedtls.git ${MBEDTLS_VERSION} --squash
4 changes: 2 additions & 2 deletions Sources/ASIO/asio/README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asio version 1.14.0
Released Sunday, 14 April 2019.
asio version 1.16.0
Released Thursday, 12 December 2019.

See doc/index.html for API documentation and a tutorial.
49 changes: 44 additions & 5 deletions Sources/ASIO/asio/asio.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@
/doc/asio/reference/basic_deadline_timer/get_executor.html
/doc/asio/reference/basic_deadline_timer.html
/doc/asio/reference/basic_deadline_timer/operator_eq_.html
/doc/asio/reference/basic_deadline_timer__rebind_executor/
/doc/asio/reference/basic_deadline_timer__rebind_executor.html
/doc/asio/reference/basic_deadline_timer__rebind_executor/other.html
/doc/asio/reference/basic_deadline_timer/time_type.html
/doc/asio/reference/basic_deadline_timer/traits_type.html
/doc/asio/reference/basic_deadline_timer/wait/
Expand Down Expand Up @@ -783,6 +786,9 @@
/doc/asio/reference/basic_serial_port/read_some.html
/doc/asio/reference/basic_serial_port/read_some/overload1.html
/doc/asio/reference/basic_serial_port/read_some/overload2.html
/doc/asio/reference/basic_serial_port__rebind_executor/
/doc/asio/reference/basic_serial_port__rebind_executor.html
/doc/asio/reference/basic_serial_port__rebind_executor/other.html
/doc/asio/reference/basic_serial_port/send_break/
/doc/asio/reference/basic_serial_port/send_break.html
/doc/asio/reference/basic_serial_port/send_break/overload1.html
Expand Down Expand Up @@ -823,6 +829,9 @@
/doc/asio/reference/basic_signal_set/executor_type.html
/doc/asio/reference/basic_signal_set/get_executor.html
/doc/asio/reference/basic_signal_set.html
/doc/asio/reference/basic_signal_set__rebind_executor/
/doc/asio/reference/basic_signal_set__rebind_executor.html
/doc/asio/reference/basic_signal_set__rebind_executor/other.html
/doc/asio/reference/basic_signal_set/remove/
/doc/asio/reference/basic_signal_set/remove.html
/doc/asio/reference/basic_signal_set/remove/overload1.html
Expand Down Expand Up @@ -944,6 +953,9 @@
/doc/asio/reference/basic_socket_acceptor/operator_eq_/overload2.html
/doc/asio/reference/basic_socket_acceptor/out_of_band_inline.html
/doc/asio/reference/basic_socket_acceptor/protocol_type.html
/doc/asio/reference/basic_socket_acceptor__rebind_executor/
/doc/asio/reference/basic_socket_acceptor__rebind_executor.html
/doc/asio/reference/basic_socket_acceptor__rebind_executor/other.html
/doc/asio/reference/basic_socket_acceptor/receive_buffer_size.html
/doc/asio/reference/basic_socket_acceptor/receive_low_watermark.html
/doc/asio/reference/basic_socket_acceptor/release/
Expand Down Expand Up @@ -1394,6 +1406,9 @@
/doc/asio/reference/basic_waitable_timer/get_executor.html
/doc/asio/reference/basic_waitable_timer.html
/doc/asio/reference/basic_waitable_timer/operator_eq_.html
/doc/asio/reference/basic_waitable_timer__rebind_executor/
/doc/asio/reference/basic_waitable_timer__rebind_executor.html
/doc/asio/reference/basic_waitable_timer__rebind_executor/other.html
/doc/asio/reference/basic_waitable_timer/time_point.html
/doc/asio/reference/basic_waitable_timer/traits_type.html
/doc/asio/reference/basic_waitable_timer/wait/
Expand Down Expand Up @@ -1702,6 +1717,9 @@
/doc/asio/reference/co_spawn/overload1.html
/doc/asio/reference/co_spawn/overload2.html
/doc/asio/reference/deadline_timer.html
/doc/asio/reference/default_completion_token/
/doc/asio/reference/default_completion_token.html
/doc/asio/reference/default_completion_token/type.html
/doc/asio/reference/defer/
/doc/asio/reference/defer.html
/doc/asio/reference/defer/overload1.html
Expand Down Expand Up @@ -2505,6 +2523,9 @@
/doc/asio/reference/ip__basic_resolver_query/protocol_type.html
/doc/asio/reference/ip__basic_resolver_query/service_name.html
/doc/asio/reference/ip__basic_resolver_query/v4_mapped.html
/doc/asio/reference/ip__basic_resolver__rebind_executor/
/doc/asio/reference/ip__basic_resolver__rebind_executor.html
/doc/asio/reference/ip__basic_resolver__rebind_executor/other.html
/doc/asio/reference/ip__basic_resolver/resolve/
/doc/asio/reference/ip__basic_resolver/resolve.html
/doc/asio/reference/ip__basic_resolver/resolve/overload10.html
Expand Down Expand Up @@ -2881,6 +2902,9 @@
/doc/asio/reference/posix__basic_descriptor/non_blocking/overload2.html
/doc/asio/reference/posix__basic_descriptor/non_blocking/overload3.html
/doc/asio/reference/posix__basic_descriptor/operator_eq_.html
/doc/asio/reference/posix__basic_descriptor__rebind_executor/
/doc/asio/reference/posix__basic_descriptor__rebind_executor.html
/doc/asio/reference/posix__basic_descriptor__rebind_executor/other.html
/doc/asio/reference/posix__basic_descriptor/release.html
/doc/asio/reference/posix__basic_descriptor/wait/
/doc/asio/reference/posix__basic_descriptor/wait.html
Expand Down Expand Up @@ -2942,6 +2966,9 @@
/doc/asio/reference/posix__basic_stream_descriptor/read_some.html
/doc/asio/reference/posix__basic_stream_descriptor/read_some/overload1.html
/doc/asio/reference/posix__basic_stream_descriptor/read_some/overload2.html
/doc/asio/reference/posix__basic_stream_descriptor__rebind_executor/
/doc/asio/reference/posix__basic_stream_descriptor__rebind_executor.html
/doc/asio/reference/posix__basic_stream_descriptor__rebind_executor/other.html
/doc/asio/reference/posix__basic_stream_descriptor/release.html
/doc/asio/reference/posix__basic_stream_descriptor/wait/
/doc/asio/reference/posix__basic_stream_descriptor/wait.html
Expand Down Expand Up @@ -3445,6 +3472,11 @@
/doc/asio/reference/transfer_exactly.html
/doc/asio/reference/use_awaitable.html
/doc/asio/reference/use_awaitable_t/
/doc/asio/reference/use_awaitable_t/as_default_on.html
/doc/asio/reference/use_awaitable_t__executor_with_default/
/doc/asio/reference/use_awaitable_t__executor_with_default/default_completion_token_type.html
/doc/asio/reference/use_awaitable_t__executor_with_default/executor_with_default.html
/doc/asio/reference/use_awaitable_t__executor_with_default.html
/doc/asio/reference/use_awaitable_t.html
/doc/asio/reference/use_awaitable_t/use_awaitable_t.html
/doc/asio/reference/use_future.html
Expand Down Expand Up @@ -3501,6 +3533,9 @@
/doc/asio/reference/windows__basic_object_handle/native_handle.html
/doc/asio/reference/windows__basic_object_handle/native_handle_type.html
/doc/asio/reference/windows__basic_object_handle/operator_eq_.html
/doc/asio/reference/windows__basic_object_handle__rebind_executor/
/doc/asio/reference/windows__basic_object_handle__rebind_executor.html
/doc/asio/reference/windows__basic_object_handle__rebind_executor/other.html
/doc/asio/reference/windows__basic_object_handle/wait/
/doc/asio/reference/windows__basic_object_handle/wait.html
/doc/asio/reference/windows__basic_object_handle/wait/overload1.html
Expand Down Expand Up @@ -3539,6 +3574,9 @@
/doc/asio/reference/windows__basic_overlapped_handle/native_handle.html
/doc/asio/reference/windows__basic_overlapped_handle/native_handle_type.html
/doc/asio/reference/windows__basic_overlapped_handle/operator_eq_.html
/doc/asio/reference/windows__basic_overlapped_handle__rebind_executor/
/doc/asio/reference/windows__basic_overlapped_handle__rebind_executor.html
/doc/asio/reference/windows__basic_overlapped_handle__rebind_executor/other.html
/doc/asio/reference/windows__basic_random_access_handle/
/doc/asio/reference/windows__basic_random_access_handle/assign/
/doc/asio/reference/windows__basic_random_access_handle/assign.html
Expand Down Expand Up @@ -3578,6 +3616,9 @@
/doc/asio/reference/windows__basic_random_access_handle/read_some_at.html
/doc/asio/reference/windows__basic_random_access_handle/read_some_at/overload1.html
/doc/asio/reference/windows__basic_random_access_handle/read_some_at/overload2.html
/doc/asio/reference/windows__basic_random_access_handle__rebind_executor/
/doc/asio/reference/windows__basic_random_access_handle__rebind_executor.html
/doc/asio/reference/windows__basic_random_access_handle__rebind_executor/other.html
/doc/asio/reference/windows__basic_random_access_handle/write_some_at/
/doc/asio/reference/windows__basic_random_access_handle/write_some_at.html
/doc/asio/reference/windows__basic_random_access_handle/write_some_at/overload1.html
Expand Down Expand Up @@ -3621,6 +3662,9 @@
/doc/asio/reference/windows__basic_stream_handle/read_some.html
/doc/asio/reference/windows__basic_stream_handle/read_some/overload1.html
/doc/asio/reference/windows__basic_stream_handle/read_some/overload2.html
/doc/asio/reference/windows__basic_stream_handle__rebind_executor/
/doc/asio/reference/windows__basic_stream_handle__rebind_executor.html
/doc/asio/reference/windows__basic_stream_handle__rebind_executor/other.html
/doc/asio/reference/windows__basic_stream_handle/write_some/
/doc/asio/reference/windows__basic_stream_handle/write_some.html
/doc/asio/reference/windows__basic_stream_handle/write_some/overload1.html
Expand Down Expand Up @@ -3718,9 +3762,7 @@
/doc/asio/tutorial/tuttimer5.html
/doc/asio/tutorial/tuttimer5/src.html
/doc/asio/using.html
/doc/._async_op1.png
/doc/async_op1.png
/doc/._async_op2.png
/doc/async_op2.png
/doc/blank.png
/doc/boostbook.css
Expand Down Expand Up @@ -3778,7 +3820,6 @@
/doc/examples/diffs/http/server/server.hpp.html
/doc/examples/diffs/invocation/
/doc/examples/diffs/invocation/prioritised_handlers.cpp.html
/doc/examples/diffs/invocation/test.cpp.html
/doc/examples/diffs/iostreams/
/doc/examples/diffs/iostreams/http_client.cpp.html
/doc/examples/diffs/local/
Expand Down Expand Up @@ -3830,10 +3871,8 @@
/doc/note.png
/doc/prev_disabled.png
/doc/prev.png
/doc/._proactor.png
/doc/proactor.png
/doc/standalone_HTML.manifest
/doc/._sync_op.png
/doc/sync_op.png
/doc/tip.png
/doc/up_disabled.png
Expand Down
Loading

0 comments on commit 0e2db0b

Please sign in to comment.