Skip to content

Commit

Permalink
Merge branch 'feature/oqs' into staging-2.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajhilje committed Jul 7, 2023
2 parents a72fb61 + a71491a commit 67de421
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 68 deletions.
52 changes: 27 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
name: CI

on:
push:
branches: [ "main", "develop" ]
pull_request:
# This action is disabled until we can run it on Apple Silicon powered macOS runners - https://github.com/github/roadmap/issues/528

jobs:
test:
name: Unit and UI Tests
runs-on: macOS-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: actions/checkout@v2
- name: Set up config files
run: |
cp IVPNClient/Config/staging.template.xcconfig IVPNClient/Config/staging.xcconfig
cp IVPNClient/Config/release.template.xcconfig IVPNClient/Config/release.xcconfig
cp wireguard-tunnel-provider/Config/wg-staging.template.xcconfig wireguard-tunnel-provider/Config/wg-staging.xcconfig
cp wireguard-tunnel-provider/Config/wg-release.template.xcconfig wireguard-tunnel-provider/Config/wg-release.xcconfig
cp IVPNWidget/Config/widget-staging.template.xcconfig IVPNWidget/Config/widget-staging.xcconfig
cp IVPNWidget/Config/widget-release.template.xcconfig IVPNWidget/Config/widget-release.xcconfig
cp IVPNClient/Config/OpenVPNConf.template.swift IVPNClient/Config/OpenVPNConf.swift
cp fastlane/Appfile.template fastlane/Appfile
- name: Build and test
run: xcodebuild test -scheme IVPNClient -destination 'platform=iOS Simulator,name=iPhone 14'
# on:
# push:
# branches: [ "main", "develop" ]
# pull_request:

# jobs:
# test:
# name: Unit and UI Tests
# runs-on: macOS-latest
# steps:
# - uses: actions/setup-go@v2
# with:
# go-version: 1.16
# - uses: actions/checkout@v2
# - name: Set up config files
# run: |
# cp IVPNClient/Config/staging.template.xcconfig IVPNClient/Config/staging.xcconfig
# cp IVPNClient/Config/release.template.xcconfig IVPNClient/Config/release.xcconfig
# cp wireguard-tunnel-provider/Config/wg-staging.template.xcconfig wireguard-tunnel-provider/Config/wg-staging.xcconfig
# cp wireguard-tunnel-provider/Config/wg-release.template.xcconfig wireguard-tunnel-provider/Config/wg-release.xcconfig
# cp IVPNWidget/Config/widget-staging.template.xcconfig IVPNWidget/Config/widget-staging.xcconfig
# cp IVPNWidget/Config/widget-release.template.xcconfig IVPNWidget/Config/widget-release.xcconfig
# cp IVPNClient/Config/OpenVPNConf.template.swift IVPNClient/Config/OpenVPNConf.swift
# cp fastlane/Appfile.template fastlane/Appfile
# - name: Build and test
# run: xcodebuild test -scheme IVPNClient -destination 'platform=iOS Simulator,name=iPhone 14'
34 changes: 30 additions & 4 deletions IVPNClient.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@
82E7169A2181E96F00D6B7C2 /* OpenVPNProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82E716952181E96F00D6B7C2 /* OpenVPNProtocol.swift */; };
82E7880C22B0DA0D00A98D76 /* NETunnelProviderProtocol+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82E7880B22B0DA0D00A98D76 /* NETunnelProviderProtocol+Ext.swift */; };
82E81AE72449C44F00D81FB7 /* PaymentComponentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82E81AE62449C44F00D81FB7 /* PaymentComponentView.swift */; };
82E96A4B224BA1B3004FC1D6 /* ExtensionKeyManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82E96A4A224BA1B3004FC1D6 /* ExtensionKeyManagerTests.swift */; };
82EA857A21DCF0C300EB0EC9 /* StorageManager+OnDemandRuleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82EA857921DCF0C300EB0EC9 /* StorageManager+OnDemandRuleTests.swift */; };
82EC883529A12BD30024CC40 /* JGProgressHUD in Frameworks */ = {isa = PBXBuildFile; productRef = 82EC883429A12BD30024CC40 /* JGProgressHUD */; };
82EC883829A12C1F0024CC40 /* Reachability in Frameworks */ = {isa = PBXBuildFile; productRef = 82EC883729A12C1F0024CC40 /* Reachability */; };
Expand Down Expand Up @@ -673,7 +672,6 @@
82E716952181E96F00D6B7C2 /* OpenVPNProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPNProtocol.swift; sourceTree = "<group>"; };
82E7880B22B0DA0D00A98D76 /* NETunnelProviderProtocol+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NETunnelProviderProtocol+Ext.swift"; sourceTree = "<group>"; };
82E81AE62449C44F00D81FB7 /* PaymentComponentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentComponentView.swift; sourceTree = "<group>"; };
82E96A4A224BA1B3004FC1D6 /* ExtensionKeyManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionKeyManagerTests.swift; sourceTree = "<group>"; };
82EA857921DCF0C300EB0EC9 /* StorageManager+OnDemandRuleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "StorageManager+OnDemandRuleTests.swift"; sourceTree = "<group>"; };
82ED17452A1259CB00E7926D /* OpenVPNNetworkExtension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OpenVPNNetworkExtension-Bridging-Header.h"; sourceTree = "<group>"; };
82ED17512A1261A000E7926D /* x25519.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = x25519.c; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1557,7 +1555,6 @@
82F81A47224CFADB00CB778B /* PeerTests.swift */,
82F81A48224CFADB00CB778B /* TunnelTests.swift */,
821BDE01224A6EC700F592BF /* AppKeyManagerTests.swift */,
82E96A4A224BA1B3004FC1D6 /* ExtensionKeyManagerTests.swift */,
);
path = WireGuard;
sourceTree = "<group>";
Expand Down Expand Up @@ -2042,7 +2039,6 @@
82A3422B24AB7F8600761AB0 /* VPNServerViewModelTests.swift in Sources */,
82F81A41224CF69900CB778B /* ArrayTests.swift in Sources */,
82F81A4A224CFADB00CB778B /* InterfaceTests.swift in Sources */,
82E96A4B224BA1B3004FC1D6 /* ExtensionKeyManagerTests.swift in Sources */,
82555005220ACAAF004763A7 /* VPNServersTests.swift in Sources */,
82F81A40224CF69900CB778B /* StringTests.swift in Sources */,
82A3422324AB660C00761AB0 /* ApplicationTests.swift in Sources */,
Expand Down Expand Up @@ -2505,11 +2501,16 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = WQXXM75BYN;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)";
GCC_C_LANGUAGE_STANDARD = gnu11;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\"";
INFOPLIST_FILE = UnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/IVPNClient/liboqs",
);
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.ivpn.clients.ios.UnitTests;
Expand All @@ -2531,11 +2532,16 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = WQXXM75BYN;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)";
GCC_C_LANGUAGE_STANDARD = gnu11;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\"";
INFOPLIST_FILE = UnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/IVPNClient/liboqs",
);
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.ivpn.clients.ios.UnitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -2634,11 +2640,16 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = WQXXM75BYN;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)";
GCC_C_LANGUAGE_STANDARD = gnu11;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\"";
INFOPLIST_FILE = UITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/IVPNClient/liboqs",
);
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.ivpn.clients.ios.UITests;
Expand All @@ -2658,11 +2669,16 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = WQXXM75BYN;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)";
GCC_C_LANGUAGE_STANDARD = gnu11;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\"";
INFOPLIST_FILE = UITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/IVPNClient/liboqs",
);
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.ivpn.clients.ios.UITests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -2681,11 +2697,16 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = WQXXM75BYN;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)";
GCC_C_LANGUAGE_STANDARD = gnu11;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\"";
INFOPLIST_FILE = UITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/IVPNClient/liboqs",
);
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.ivpn.clients.ios.UITests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -2808,11 +2829,16 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = WQXXM75BYN;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)";
GCC_C_LANGUAGE_STANDARD = gnu11;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\"";
INFOPLIST_FILE = UnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited)";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/IVPNClient/liboqs",
);
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.ivpn.clients.ios.UnitTests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Link liboqs"
scriptText = "if [ &quot;${PLATFORM_NAME}&quot; == &quot;iphoneos&quot; ]; then&#10; LIBOQS_LIB=&quot;liboqs-iphoneos.a&quot;&#10;else&#10; LIBOQS_LIB=&quot;liboqs-iphonesimulator.a&quot;&#10;fi&#10;&#10;cp &quot;${SRCROOT}/IVPNClient/liboqs/${LIBOQS_LIB}&quot; &quot;${SRCROOT}/IVPNClient/liboqs/liboqs.a&quot;&#10;">
scriptText = "if [ &quot;${PLATFORM_NAME}&quot; == &quot;iphoneos&quot; ]; then&#10; LIBOQS_LIB=&quot;liboqs-iphoneos.a&quot;&#10;else&#10; LIBOQS_LIB=&quot;liboqs-iphonesimulator.a&quot;&#10;fi&#10;&#10;if test -f &quot;${SRCROOT}/IVPNClient/liboqs/${LIBOQS_LIB}&quot;; then&#10; cp &quot;${SRCROOT}/IVPNClient/liboqs/${LIBOQS_LIB}&quot; &quot;${SRCROOT}/IVPNClient/liboqs/liboqs.a&quot;&#10;fi&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
Expand Down
2 changes: 1 addition & 1 deletion IVPNClient/Managers/AppKeyManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class AppKeyManager {
]

var kem = KEM()
params = params + [URLQueryItem(name: "kem_public_key1", value: kem.getPublicKey(algorithm: .Kyber1024))]
params += [URLQueryItem(name: "kem_public_key1", value: kem.getPublicKey(algorithm: .Kyber1024))]
let request = ApiRequestDI(method: .post, endpoint: Config.apiSessionWGKeySet, params: params)

delegate?.setKeyStart()
Expand Down
7 changes: 7 additions & 0 deletions UnitTests/WireGuard/AppKeyManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,11 @@ class AppKeyManagerTests: XCTestCase {
XCTAssertTrue(KeyChain.wgPublicKey != nil)
}

func test_regenerationInterval() {
UserDefaults.shared.set(Config.wgKeyRegenerationRate, forKey: UserDefaults.Key.wgRegenerationRate)
let regenerationCheckInterval = AppKeyManager.regenerationCheckInterval
let regenerationInterval = AppKeyManager.regenerationInterval
XCTAssertTrue(regenerationInterval > regenerationCheckInterval)
}

}
37 changes: 0 additions & 37 deletions UnitTests/WireGuard/ExtensionKeyManagerTests.swift

This file was deleted.

0 comments on commit 67de421

Please sign in to comment.