From c68c214cbfb250d2c3454143d0279c37d3eb6aa0 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Wed, 24 Oct 2018 11:36:20 +0530 Subject: [PATCH] Crypto: Add Curve25519 C code to project --- WireGuard/WireGuard.xcodeproj/project.pbxproj | 22 +++++++++++++++++++ .../WireGuard/WireGuard-Bridging-Header.h | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 WireGuard/WireGuard/WireGuard-Bridging-Header.h diff --git a/WireGuard/WireGuard.xcodeproj/project.pbxproj b/WireGuard/WireGuard.xcodeproj/project.pbxproj index 17f8d5b..c5b7631 100644 --- a/WireGuard/WireGuard.xcodeproj/project.pbxproj +++ b/WireGuard/WireGuard.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 6F628C3D217F09E9003482A3 /* TunnelViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F628C3C217F09E9003482A3 /* TunnelViewModel.swift */; }; 6F628C3F217F3413003482A3 /* DNSServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F628C3E217F3413003482A3 /* DNSServer.swift */; }; 6F628C41217F47DB003482A3 /* TunnelDetailTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F628C40217F47DB003482A3 /* TunnelDetailTableViewController.swift */; }; + 6F6899A62180447E0012E523 /* x25519.c in Sources */ = {isa = PBXBuildFile; fileRef = 6F6899A52180447E0012E523 /* x25519.c */; }; 6F693A562179E556008551C1 /* Endpoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F693A552179E556008551C1 /* Endpoint.swift */; }; 6F7774E1217181B1006A79B3 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7774DF217181B1006A79B3 /* MainViewController.swift */; }; 6F7774E2217181B1006A79B3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7774E0217181B1006A79B3 /* AppDelegate.swift */; }; @@ -27,6 +28,9 @@ 6F628C3C217F09E9003482A3 /* TunnelViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelViewModel.swift; sourceTree = ""; }; 6F628C3E217F3413003482A3 /* DNSServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DNSServer.swift; sourceTree = ""; }; 6F628C40217F47DB003482A3 /* TunnelDetailTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TunnelDetailTableViewController.swift; sourceTree = ""; }; + 6F689999218043390012E523 /* WireGuard-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WireGuard-Bridging-Header.h"; sourceTree = ""; }; + 6F6899A42180447E0012E523 /* x25519.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x25519.h; sourceTree = ""; }; + 6F6899A52180447E0012E523 /* x25519.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = x25519.c; sourceTree = ""; }; 6F693A552179E556008551C1 /* Endpoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Endpoint.swift; sourceTree = ""; }; 6F7774DF217181B1006A79B3 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; 6F7774E0217181B1006A79B3 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -56,6 +60,15 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 6F6899A32180445A0012E523 /* Crypto */ = { + isa = PBXGroup; + children = ( + 6F6899A52180447E0012E523 /* x25519.c */, + 6F6899A42180447E0012E523 /* x25519.h */, + ); + path = Crypto; + sourceTree = ""; + }; 6F7774DD217181B1006A79B3 /* UI */ = { isa = PBXGroup; children = ( @@ -116,6 +129,7 @@ 6FF4AC16211EC46F002C96EB /* WireGuard */ = { isa = PBXGroup; children = ( + 6F6899A32180445A0012E523 /* Crypto */, 6F7774E6217201E0006A79B3 /* Model */, 6F7774DD217181B1006A79B3 /* UI */, 6F7774ED21722D0C006A79B3 /* VPN */, @@ -124,6 +138,7 @@ 6FF4AC20211EC472002C96EB /* LaunchScreen.storyboard */, 6FF4AC23211EC472002C96EB /* Info.plist */, 6FF4AC2B211EC776002C96EB /* Developer.xcconfig */, + 6F689999218043390012E523 /* WireGuard-Bridging-Header.h */, ); path = WireGuard; sourceTree = ""; @@ -168,6 +183,7 @@ TargetAttributes = { 6FF4AC13211EC46F002C96EB = { CreatedOnToolsVersion = 9.4.1; + LastSwiftMigration = 1000; SystemCapabilities = { com.apple.NetworkExtensions.iOS = { enabled = 1; @@ -214,6 +230,7 @@ 6F7774E421718281006A79B3 /* TunnelsListTableViewController.swift in Sources */, 6F7774EF21722D97006A79B3 /* TunnelsManager.swift in Sources */, 6F693A562179E556008551C1 /* Endpoint.swift in Sources */, + 6F6899A62180447E0012E523 /* x25519.c in Sources */, 6F7774E2217181B1006A79B3 /* AppDelegate.swift in Sources */, 6F628C3F217F3413003482A3 /* DNSServer.swift in Sources */, 6F628C3D217F09E9003482A3 /* TunnelViewModel.swift in Sources */, @@ -359,6 +376,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = WireGuard/WireGuard.entitlements; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = WireGuard/Info.plist; @@ -369,6 +387,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "WireGuard/WireGuard-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -378,6 +398,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = WireGuard/WireGuard.entitlements; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = WireGuard/Info.plist; @@ -388,6 +409,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "WireGuard/WireGuard-Bridging-Header.h"; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/WireGuard/WireGuard/WireGuard-Bridging-Header.h b/WireGuard/WireGuard/WireGuard-Bridging-Header.h new file mode 100644 index 0000000..893b5eb --- /dev/null +++ b/WireGuard/WireGuard/WireGuard-Bridging-Header.h @@ -0,0 +1,5 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + +#include "x25519.h"