diff --git a/.gitignore b/.gitignore index 84fdff138e..fa90cc54de 100644 --- a/.gitignore +++ b/.gitignore @@ -344,6 +344,8 @@ doc/pdf # XCODE Index IDE/XCODE/Index +IDE/**/xcshareddata +IDE/**/DerivedData # ARM DS-5 && Eclipse \.settings/ diff --git a/IDE/apple-universal/.gitignore b/IDE/apple-universal/.gitignore new file mode 100644 index 0000000000..de153db3b7 --- /dev/null +++ b/IDE/apple-universal/.gitignore @@ -0,0 +1 @@ +artifacts diff --git a/IDE/apple-universal/README.md b/IDE/apple-universal/README.md new file mode 100644 index 0000000000..576115468f --- /dev/null +++ b/IDE/apple-universal/README.md @@ -0,0 +1,92 @@ +# Overview +This example shows how to build a wolfSSL static library for Apple targets on all architectures using GNU autotools/`configure` and demonstrates how to create a [universal binary framework]() suitable for use in an Xcode project. It also provides a demo Xcode project using the wolfSSL framework in a simple multiplatform app. + +The example was created using Xcode version 14.3.1. + +# Why? +Configuring and building wolfSSL through the `configure` interface can be simpler and more user friendly than manually adding the wolfSSL source files to your project and customizing through `user_settings.h`. Building via `configure` also streamlines integration with other open-source projects that expect an installation directory, such as `cURL`'s `--with-wolfssl` option. Finally, some developer teams might prefer to build wolfSSL once with the desired settings and then distribute it as a library framework for app developers to use. Packaging wolfSSL as a framework makes it highly portable and allows for drag-and-drop integration into Xcode projects without needing to worry about compiling the library every time they build their app. + +However, if you do want to compile wolfSSL from source manually in your Xcode project using `user_settings.h`, see the example in [IDE/XCODE](https://github.com/wolfSSL/wolfssl/tree/master/IDE/XCODE). + +# Example overview +This example consists of a build script and an Xcode example project. The build script generates a static library framework for all Apple targets. The Example project shows how to incorporate the framework into an Xcode project and wolfSSL framework in a simple application. + +## The build script +`build-wolfssl-framework.sh` compiles wolfSSL as static library for all modern Apple platforms and simulators. This includes MacOS (`arm64`,`x86_64`), iPhone (`arm64`), iPhoneSimulator (`arm64`,`x86_64`), appleTV (`arm64`), appleTVSimulator (`arm64`,`x86_64`), appleWatch (`arm64`), and appleWatchSimulator (`arm64`,`x86_64`). The script compiles wolfSSL for each platform, creates universal binaries for platforms that support multiple architectures (macOS and simulators) using [lipo](https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary), then combines all the static libraries together into an `xcframework` that can be imported into Xcode. It is meant to be used as an example rather than a build tool, and chooses simplicity and readability over flexibility (no command line options). For an explanation of how the script cross compiles wolfSSL, see the [Technical Details](technical-details) section. + +To use the build script, you can run it without arguments to build a default configuration, or you can use the `-c` option to pass in a quoted string containing any additional flags to `configure` that you need. Note that `--enable-static --disable-shared` is always passed to `configure` by default. Consider the following usage example, with descriptions in the comments: + +``` +# default configuration +./build-wolfssl-framework.sh + +# hardened configuration with curl support and FIPS-ready crypto +./build-wolfssl-framework.sh -c "--enable-harden --enable-curl --enable-fips=ready" + +``` + +## Example project +`wolfssl-multiplatform` is an xcode project containing a simple swiftUI "hello world" app that has been modified to run the wolfCrypt tests and establish a TLS connection to `www.wolfssl.com` on startup. It also provides an example for basic Swift/C interoperability using a "bridging header". When the app launches, the swiftUI initialization handler calls a C test driver function, which is responsible for running the wolfSSL examples. An overview of the additional files is as follows: + +``` +. +└── wolfssl-multiplatform + ├── wolfssl-multiplatform + │   ├── ContentView.swift # <-- boilerplate swiftUI modified to call wolfSSL test driver on UI init + │   ├── wolfssl_multiplatformApp.swift # <-- basic swift hello world + + │   ├── simple_client_example.c # <-- Simple TLS example that connects to wolfssl.com + │   ├── simple_client_example.h + + │   ├── wolfssl-multiplatform-Bridging-Header.h # <-- "bridging header" that exposes wolfssl_test_driver app to swift + │   ├── wolfssl_test_driver.c # <-- test driver function that runs wolfCrypt tests then calls simple_client_example + │   └── wolfssl_test_driver.h +``` + +For a basic overview on how to call C code from Swift in an Xcode project, see this excellent blog post tutorial: +- [https://rlaguilar.com/posts/integrate-c-library-ios-project-swift](https://rlaguilar.com/posts/integrate-c-library-ios-project-swift) + +More detailed information on swift/C interoperability can be found in the Apple swift language guide, as well as in the official swift documentation: +- [https://developer.apple.com/documentation/swift/c-interoperability](https://developer.apple.com/documentation/swift/c-interoperability) +- [https://www.swift.org/documentation/cxx-interop](https://www.swift.org/documentation/cxx-interop) + +## Adding the framework to an Xcode project +In order to add the framework to any Xcode project, you can simply drag-and-drop the `artifacts/xcframework/libwolfssl.xcframework` directory into Xcode's project source navigator pane. This should automatically add it to the linked libraries for your application. + +# Technical Details + +## Cross compilation +If you are developing on a macOS machine and want to compile wolfSSL to run on macOS, then you can simply use `configure` without further customisation. However, if you wish to build wolfSSL to run on a different Apple device, then you need to cross-compile wolfSSL. Thankfully, `configure` makes cross compilation relatively straightforward by using the `--host` argument to pass the "[target triple](https://wiki.osdev.org/Target_Triplet)" describing the platform of the system on which you wish the binary to run, as well as a few other options which will are described below. For more details on cross-compilation, please see the [GNU cross-compilation documentation](https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html) and the [wolfSSL manual page on cross-compiling with configure](https://www.wolfssl.com/documentation/manuals/wolfssl/chapter02.html#building-with-configure-with-cross-compile). Note that `clang` is the default compiler on macOS (symlinked to `/usr/bin/gcc`) and natively supports cross compilation for all Apple devices without requiring you to download a separate compiler. This means you do not need to overide the system `CC`/`AR`/`RANLIB` etc. when using configure. + +The generic `configure` invocation required to cross compile a static library for an Apple device is as follows: + +``` +./configure --disable-shared --enable-static \ + --prefix=${INSTALL_DIR} \ + --host=${HOST} \ + CFLAGS="-arch ${ARCH} -isysroot ${SDK_ROOT}" + +``` +where the +- `${INSTALL_DIR}` holds the path to the output directory for the wolfSSL install (which we will later include in the framework) +- `--host=${HOST}` is the triple describing the platform. It should be set to `${ARCH}-apple-darwin` for all targets +- `-arch ${ARCH}` is the CPU architecture of the platform. It should be `x86_64` for intel Macs and `arm64` for iPhone, appleTV, appleWatch, and Apple silicon Macs. +- `-isysroot ${SDK_ROOT}` is the path to the new sysroot for the target platform of cross compilation, which is where the compiler should look for system headers and libraries (which are usually different for the target system than for the host system when cross compiling). You can use the Xcode command line tools to query the SDK root path for a given target by running `xcrun --sdk --show-sdk-path`. To get a list of installed targets, run `xcodebuild -showsdks`. + + +## Universal binaries +Apple intoduced two technologies to facilitate packaging portable libraries: "universal binaries" and "frameworks". + +Universal binaries (a.k.a "fat" binaries) allow `elf` files targeting multiple CPU architectures to be combined into a single file (e.g. `x86_64` and `arm64`). These binaries are created using a tool called `lipo`. For more information on lipo and universal binaries, see [Creating Universal Binaries](https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary). + +## Frameworks +In order to facilitate distribution binaries and dependencies, Apple introduced the concept of an `xcframework` bundle, which is a distribution format that allows developers to bundle binaries targeting multiple architectures together with their headers and other metadata. All builds of a library under all target platforms and architectures complete with their dependencies now can be packed ino one single bundle under the `.xcframework` extension. + +## Issues with the process +Low-level programming in the Apple ecosystem is sparsely documented, and certain things that you think "should just work" don't. Here are a few issues we had with the process that need to be documented. + +1. Apps meant to run on a simulator require building for/linking against universal binaries containing architecture slices for both `x86_64` and `arm64`. Even if you have the correct architecture (e.g. compiling on `arm64` and targeting an `arm64` simulator host) Xcode will complain that you have compiled the binary for the wrong host if the elf file does not include an `x86_64` architecture slice. Therefore, `build-wolfssl-framework.sh` builds all libraries for simulator targets for both `x86_64` and `arm64` architectures and links them as universal binaries with `lipo`. Again, it DOES NOT MATTER if you are targeting the correct architecture with your cross-compilation, Xcode will not recognize the binary as targeting the correct architecture unless it contains both. + +2. Cross compiling for the **iOS simulator** with a min version specifier present (`-miphoneos-version-min`) requires the `-target ${ARCH}-apple-ios-simulator` compiler flag in order to build . It is unclear why this is required, as The GNU documentation claims that the `target` option is only required if cross-compiling a compiler to run on architecture X but emit code for architecture Y (known as a canadian cross-compilation scenario). Regardless, if you do not include a `-target` option, the build will generate a large number of warnings when linking against system libraries with messages like: `ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/lib/libnetwork.tbd) built for iOS Simulator`. It was thought that perhaps the host option should instead be `--host=${ARCH}-apple-ios-simulator` but this is not a valid option, and `configure` will fail with a different error: `checking host system type... Invalid configuration 'arm64-apple-ios-simulator': Kernel 'ios' not known to work with OS 'simulator`. If you do not specify a min iOS version, this is not required. Mysteriously, the other simulators (tvOS, watchOS) do not have this issue.... + + diff --git a/IDE/apple-universal/build-wolfssl-framework.sh b/IDE/apple-universal/build-wolfssl-framework.sh new file mode 100755 index 0000000000..14b3db3286 --- /dev/null +++ b/IDE/apple-universal/build-wolfssl-framework.sh @@ -0,0 +1,333 @@ +#!/bin/bash + +# build-wolfssl-framework.sh +# +# Copyright (C) 2006-2023 wolfSSL Inc. +# +# This file is part of wolfSSL. +# +# wolfSSL is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# wolfSSL is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + + +set -euo pipefail + +WOLFSSL_DIR=$(pwd)/../../ +OUTDIR=$(pwd)/artifacts +LIPODIR=${OUTDIR}/lib +SDK_OUTPUT_DIR=${OUTDIR}/xcframework + + +CFLAGS_COMMON="" +# Optional configure flags passed in by user through -c argument +CONF_OPTS_EXTRA="" +# Base configure flags +CONF_OPTS_COMMON="--disable-shared --enable-static" + +helpFunction() +{ + echo "" + echo "Usage: $0 [-c ]" + echo -e "\t-c Extra flags to be passed to ./configure" + exit 1 # Exit script after printing help +} + +# Parse command line arguments +while getopts ":c:" opt; do + case $opt in + c) + CONF_OPTS_EXTRA="$OPTARG" + ;; + \?) + echo "Invalid option: -$OPTARG" >&2; helpFunction + ;; + esac +done + +# Amalgamate extra CLI options with base options +CONF_OPTS="${CONF_OPTS_COMMON} ${CONF_OPTS_EXTRA}" + +rm -rf $OUTDIR +mkdir -p $LIPODIR +mkdir -p $SDK_OUTPUT_DIR + + +buildIOSSim() +{ + set -x + pushd . + cd $WOLFSSL_DIR + + ARCH=$1 + HOST="${ARCH}-apple-darwin" + SDK_ROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) + + ./configure -prefix=${OUTDIR}/wolfssl-ios-simulator-${ARCH} ${CONF_OPTS} --host=${HOST} \ + CFLAGS="${CFLAGS_COMMON} -arch ${ARCH} -isysroot ${SDK_ROOT}" + make -j + make install + + popd + set +x +} + +buildIOS() +{ + set -x + pushd . + cd $WOLFSSL_DIR + + ARCH=$1 + HOST="${ARCH}-apple-darwin" + SDK_ROOT=$(xcrun --sdk iphoneos --show-sdk-path) + + ./configure -prefix=${OUTDIR}/wolfssl-ios-${ARCH} ${CONF_OPTS} --host=${HOST} \ + CFLAGS="${CFLAGS_COMMON} -arch ${ARCH} -isysroot ${SDK_ROOT}" + make -j + make install + + popd + set +x +} + +buildMacOS() +{ + set -x + pushd . + cd $WOLFSSL_DIR + + ARCH=$1 + HOST="${ARCH}-apple-darwin" + SDK_ROOT=$(xcrun --sdk macosx --show-sdk-path) + + ./configure -prefix=${OUTDIR}/wolfssl-macos-${ARCH} ${CONF_OPTS} --host=${HOST} \ + CFLAGS="${CFLAGS_COMMON} -arch ${ARCH} -isysroot ${SDK_ROOT}" + make -j + make install + + popd + set +x +} + +buildWatchOS() +{ + set -x + pushd . + cd $WOLFSSL_DIR + + ARCH=$1 + HOST="${ARCH}-apple-darwin" + SDK_ROOT=$(xcrun --sdk watchos --show-sdk-path) + + ./configure -prefix=${OUTDIR}/wolfssl-watchos-${ARCH} ${CONF_OPTS} --host=${HOST} \ + CFLAGS="${CFLAGS_COMMON} -arch ${ARCH} -isysroot ${SDK_ROOT}" + make -j + make install + + popd + set +x +} + +buildWatchOSSim() +{ + set -x + pushd . + cd $WOLFSSL_DIR + + ARCH=$1 + HOST="${ARCH}-apple-darwin" + SDK_ROOT=$(xcrun --sdk watchsimulator --show-sdk-path) + + ./configure -prefix=${OUTDIR}/wolfssl-watchos-simulator-${ARCH} ${CONF_OPTS} --host=${HOST} \ + CFLAGS="${CFLAGS_COMMON} -arch ${ARCH} -isysroot ${SDK_ROOT}" + make -j + make install + + popd + set +x +} + +buildTVOS() +{ + set -x + pushd . + cd $WOLFSSL_DIR + + ARCH=arm64 + HOST="${ARCH}-apple-darwin" + SDK_ROOT=$(xcrun --sdk appletvos --show-sdk-path) + + ./configure -prefix=${OUTDIR}/wolfssl-tvos-${ARCH} ${CONF_OPTS} --host=${HOST} \ + CFLAGS="${CFLAGS_COMMON} -arch ${ARCH} -isysroot ${SDK_ROOT}" + make -j + make install + + popd + set +x +} + +buildTVOSSim() +{ + set -x + pushd . + cd $WOLFSSL_DIR + + ARCH=$1 + HOST="${ARCH}-apple-darwin" + SDK_ROOT=$(xcrun --sdk appletvsimulator --show-sdk-path) + + ./configure -prefix=${OUTDIR}/wolfssl-tvos-simulator-${ARCH} ${CONF_OPTS} --host=${HOST} \ + CFLAGS="${CFLAGS_COMMON} -arch ${ARCH} -isysroot ${SDK_ROOT}" + make -j + make install + + popd + set +x +} + +buildCatalyst() +{ + echo "TBD" +} + +############################################################################################################################################ +# IOS Simulator ############################################################################################################################ +############################################################################################################################################ +buildIOSSim arm64 +buildIOSSim x86_64 + +# Create universal binaries from architecture-specific static libraries +lipo \ + "$OUTDIR/wolfssl-ios-simulator-x86_64/lib/libwolfssl.a" \ + "$OUTDIR/wolfssl-ios-simulator-arm64/lib/libwolfssl.a" \ + -create -output $LIPODIR/libwolfssl-ios-simulator.a + +echo "Checking libraries" +xcrun -sdk iphonesimulator lipo -info $LIPODIR/libwolfssl-ios-simulator.a + +############################################################################################################################################ +# IOS ###################################################################################################################################### +############################################################################################################################################ +buildIOS arm64 + +# Create universal binaries from architecture-specific static libraries +lipo \ + "$OUTDIR/wolfssl-ios-arm64/lib/libwolfssl.a" \ + -create -output $LIPODIR/libwolfssl-ios.a + +echo "Checking libraries" +xcrun -sdk iphoneos lipo -info $LIPODIR/libwolfssl-ios.a + + +############################################################################################################################################ +# MacOS #################################################################################################################################### +############################################################################################################################################ +buildMacOS arm64 +buildMacOS x86_64 + +# Create universal binaries from architecture-specific static libraries +lipo \ + "$OUTDIR/wolfssl-macos-x86_64/lib/libwolfssl.a" \ + "$OUTDIR/wolfssl-macos-arm64/lib/libwolfssl.a" \ + -create -output $LIPODIR/libwolfssl-macos.a + +echo "Checking libraries" +xcrun -sdk macosx lipo -info $LIPODIR/libwolfssl-macos.a + + +############################################################################################################################################ +# tvOS Simulator ########################################################################################################################### +############################################################################################################################################ +buildTVOSSim arm64 +buildTVOSSim x86_64 + +# Create universal binaries from architecture-specific static libraries +lipo \ + "$OUTDIR/wolfssl-tvos-simulator-x86_64/lib/libwolfssl.a" \ + "$OUTDIR/wolfssl-tvos-simulator-arm64/lib/libwolfssl.a" \ + -create -output $LIPODIR/libwolfssl-tvos-simulator.a + +echo "Checking libraries" +xcrun -sdk appletvsimulator lipo -info $LIPODIR/libwolfssl-tvos-simulator.a + + +############################################################################################################################################ +# tvOS ##################################################################################################################################### +############################################################################################################################################ +buildTVOS arm64 + +# Create universal binaries from architecture-specific static libraries +lipo \ + "$OUTDIR/wolfssl-tvos-arm64/lib/libwolfssl.a" \ + -create -output $LIPODIR/libwolfssl-tvos.a + +echo "Checking libraries" +xcrun -sdk appletvos lipo -info $LIPODIR/libwolfssl-tvos.a + + +############################################################################################################################################ +# watchOS Simulator ######################################################################################################################## +############################################################################################################################################ +buildWatchOSSim arm64 +buildWatchOSSim x86_64 + +# Create universal binaries from architecture-specific static libraries +lipo \ + "$OUTDIR/wolfssl-watchos-simulator-arm64/lib/libwolfssl.a" \ + "$OUTDIR/wolfssl-watchos-simulator-x86_64/lib/libwolfssl.a" \ + -create -output $LIPODIR/libwolfssl-watchos-simulator.a + +echo "Checking libraries" +xcrun -sdk watchsimulator lipo -info $LIPODIR/libwolfssl-watchos-simulator.a + + +############################################################################################################################################ +# watchOS ################################################################################################################################## +############################################################################################################################################ +buildWatchOS arm64 + +# Create universal binaries from architecture-specific static libraries +lipo \ + "$OUTDIR/wolfssl-watchos-arm64/lib/libwolfssl.a" \ + -create -output $LIPODIR/libwolfssl-watchos.a + +echo "Checking libraries" +xcrun -sdk watchos lipo -info $LIPODIR/libwolfssl-watchos.a + + +############################################################################################################################################ +# Catalyst ################################################################################################################################# +############################################################################################################################################ + + +############################################################################################################################################ +# ********** BUILD FRAMEWORK +############################################################################################################################################ + +xcodebuild -create-xcframework \ + -library ${LIPODIR}/libwolfssl-ios-simulator.a \ + -headers ${OUTDIR}/wolfssl-ios-simulator-arm64/include \ + -library ${LIPODIR}/libwolfssl-ios.a \ + -headers ${OUTDIR}/wolfssl-ios-arm64/include \ + -library ${LIPODIR}/libwolfssl-macos.a \ + -headers ${OUTDIR}/wolfssl-macos-arm64/include \ + -library ${LIPODIR}/libwolfssl-tvos.a \ + -headers ${OUTDIR}/wolfssl-tvos-arm64/include \ + -library ${LIPODIR}/libwolfssl-tvos-simulator.a \ + -headers ${OUTDIR}/wolfssl-tvos-simulator-arm64/include \ + -library ${LIPODIR}/libwolfssl-watchos.a \ + -headers ${OUTDIR}/wolfssl-watchos-arm64/include \ + -library ${LIPODIR}/libwolfssl-watchos-simulator.a \ + -headers ${OUTDIR}/wolfssl-watchos-simulator-arm64/include \ + -output ${SDK_OUTPUT_DIR}/libwolfssl.xcframework diff --git a/IDE/apple-universal/include.am b/IDE/apple-universal/include.am new file mode 100644 index 0000000000..a275b07332 --- /dev/null +++ b/IDE/apple-universal/include.am @@ -0,0 +1,24 @@ +# vim:ft=automake +# included from Top Level Makefile.am +# All paths should be given relative to the root +# + +EXTRA_DIST+= IDE/apple-universal/README.md +EXTRA_DIST+= IDE/apple-universal/build-wolfssl-framework.sh +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform.xcodeproj/project.pbxproj +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.c +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.h +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.c +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.h +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl-multiplatform-Bridging-Header.h +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatformApp.swift +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/ContentView.swift +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/AppIcon.appiconset/Contents.json +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/AccentColor.colorset/Contents.json +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/Contents.json +EXTRA_DIST+= IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatform.entitlements + + + + + diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform.xcodeproj/project.pbxproj b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..2a20aa779a --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform.xcodeproj/project.pbxproj @@ -0,0 +1,403 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 8BC456822A5DCC3D008A4AF7 /* wolfssl_multiplatformApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC456812A5DCC3D008A4AF7 /* wolfssl_multiplatformApp.swift */; }; + 8BC456842A5DCC3D008A4AF7 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC456832A5DCC3D008A4AF7 /* ContentView.swift */; }; + 8BC456862A5DCC3F008A4AF7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8BC456852A5DCC3F008A4AF7 /* Assets.xcassets */; }; + 8BC456922A5DD04E008A4AF7 /* libwolfssl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BC456912A5DD04E008A4AF7 /* libwolfssl.xcframework */; }; + 8BC456972A5DD1F2008A4AF7 /* wolfssl_test_driver.c in Sources */ = {isa = PBXBuildFile; fileRef = 8BC456962A5DD1F2008A4AF7 /* wolfssl_test_driver.c */; }; + 8BC456AB2A5DF7A6008A4AF7 /* test.c in Sources */ = {isa = PBXBuildFile; fileRef = 8BC456AA2A5DF7A6008A4AF7 /* test.c */; settings = {COMPILER_FLAGS = "-DUSE_FLAT_TEST_H -DNO_MAIN_DRIVER -DNO_FILESYSTEM -DSINGLE_THREADED"; }; }; + 8BC456AE2A5DF7BA008A4AF7 /* benchmark.c in Sources */ = {isa = PBXBuildFile; fileRef = 8BC456AC2A5DF7BA008A4AF7 /* benchmark.c */; settings = {COMPILER_FLAGS = "-DUSE_FLAT_BENCHMARK_H -DNO_MAIN_DRIVER -DSINGLE_THREADED"; }; }; + 8BC456F32A5F20C8008A4AF7 /* simple_client_example.c in Sources */ = {isa = PBXBuildFile; fileRef = 8BC456F12A5F20C8008A4AF7 /* simple_client_example.c */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 8BC4567E2A5DCC3D008A4AF7 /* wolfssl-multiplatform.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "wolfssl-multiplatform.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8BC456812A5DCC3D008A4AF7 /* wolfssl_multiplatformApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = wolfssl_multiplatformApp.swift; sourceTree = ""; }; + 8BC456832A5DCC3D008A4AF7 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 8BC456852A5DCC3F008A4AF7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 8BC456872A5DCC3F008A4AF7 /* wolfssl_multiplatform.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = wolfssl_multiplatform.entitlements; sourceTree = ""; }; + 8BC456912A5DD04E008A4AF7 /* libwolfssl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libwolfssl.xcframework; path = ../artifacts/xcframework/libwolfssl.xcframework; sourceTree = ""; }; + 8BC456942A5DD1F2008A4AF7 /* wolfssl-multiplatform-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "wolfssl-multiplatform-Bridging-Header.h"; sourceTree = ""; }; + 8BC456952A5DD1F2008A4AF7 /* wolfssl_test_driver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wolfssl_test_driver.h; sourceTree = ""; }; + 8BC456962A5DD1F2008A4AF7 /* wolfssl_test_driver.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wolfssl_test_driver.c; sourceTree = ""; }; + 8BC456A92A5DF7A6008A4AF7 /* test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = test.h; path = ../../../../wolfcrypt/test/test.h; sourceTree = ""; }; + 8BC456AA2A5DF7A6008A4AF7 /* test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test.c; path = ../../../../wolfcrypt/test/test.c; sourceTree = ""; }; + 8BC456AC2A5DF7BA008A4AF7 /* benchmark.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = benchmark.c; path = ../../../../wolfcrypt/benchmark/benchmark.c; sourceTree = ""; }; + 8BC456AD2A5DF7BA008A4AF7 /* benchmark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = benchmark.h; path = ../../../../wolfcrypt/benchmark/benchmark.h; sourceTree = ""; }; + 8BC456F12A5F20C8008A4AF7 /* simple_client_example.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = simple_client_example.c; sourceTree = ""; }; + 8BC456F22A5F20C8008A4AF7 /* simple_client_example.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simple_client_example.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8BC4567B2A5DCC3D008A4AF7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BC456922A5DD04E008A4AF7 /* libwolfssl.xcframework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8BC456752A5DCC3D008A4AF7 = { + isa = PBXGroup; + children = ( + 8BC456802A5DCC3D008A4AF7 /* wolfssl-multiplatform */, + 8BC4567F2A5DCC3D008A4AF7 /* Products */, + 8BC456902A5DD04E008A4AF7 /* Frameworks */, + ); + sourceTree = ""; + }; + 8BC4567F2A5DCC3D008A4AF7 /* Products */ = { + isa = PBXGroup; + children = ( + 8BC4567E2A5DCC3D008A4AF7 /* wolfssl-multiplatform.app */, + ); + name = Products; + sourceTree = ""; + }; + 8BC456802A5DCC3D008A4AF7 /* wolfssl-multiplatform */ = { + isa = PBXGroup; + children = ( + 8BC456A82A5DF787008A4AF7 /* wolfssl-test-apps */, + 8BC456812A5DCC3D008A4AF7 /* wolfssl_multiplatformApp.swift */, + 8BC456832A5DCC3D008A4AF7 /* ContentView.swift */, + 8BC456852A5DCC3F008A4AF7 /* Assets.xcassets */, + 8BC456872A5DCC3F008A4AF7 /* wolfssl_multiplatform.entitlements */, + 8BC456952A5DD1F2008A4AF7 /* wolfssl_test_driver.h */, + 8BC456962A5DD1F2008A4AF7 /* wolfssl_test_driver.c */, + 8BC456942A5DD1F2008A4AF7 /* wolfssl-multiplatform-Bridging-Header.h */, + ); + path = "wolfssl-multiplatform"; + sourceTree = ""; + }; + 8BC456902A5DD04E008A4AF7 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8BC456912A5DD04E008A4AF7 /* libwolfssl.xcframework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8BC456A82A5DF787008A4AF7 /* wolfssl-test-apps */ = { + isa = PBXGroup; + children = ( + 8BC456F12A5F20C8008A4AF7 /* simple_client_example.c */, + 8BC456F22A5F20C8008A4AF7 /* simple_client_example.h */, + 8BC456AC2A5DF7BA008A4AF7 /* benchmark.c */, + 8BC456AD2A5DF7BA008A4AF7 /* benchmark.h */, + 8BC456AA2A5DF7A6008A4AF7 /* test.c */, + 8BC456A92A5DF7A6008A4AF7 /* test.h */, + ); + name = "wolfssl-test-apps"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8BC4567D2A5DCC3D008A4AF7 /* wolfssl-multiplatform */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8BC4568D2A5DCC3F008A4AF7 /* Build configuration list for PBXNativeTarget "wolfssl-multiplatform" */; + buildPhases = ( + 8BC4567A2A5DCC3D008A4AF7 /* Sources */, + 8BC4567B2A5DCC3D008A4AF7 /* Frameworks */, + 8BC4567C2A5DCC3D008A4AF7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "wolfssl-multiplatform"; + productName = "wolfssl-multiplatform"; + productReference = 8BC4567E2A5DCC3D008A4AF7 /* wolfssl-multiplatform.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8BC456762A5DCC3D008A4AF7 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1430; + LastUpgradeCheck = 1430; + TargetAttributes = { + 8BC4567D2A5DCC3D008A4AF7 = { + CreatedOnToolsVersion = 14.3.1; + LastSwiftMigration = 1430; + }; + }; + }; + buildConfigurationList = 8BC456792A5DCC3D008A4AF7 /* Build configuration list for PBXProject "wolfssl-multiplatform" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8BC456752A5DCC3D008A4AF7; + productRefGroup = 8BC4567F2A5DCC3D008A4AF7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8BC4567D2A5DCC3D008A4AF7 /* wolfssl-multiplatform */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8BC4567C2A5DCC3D008A4AF7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BC456862A5DCC3F008A4AF7 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8BC4567A2A5DCC3D008A4AF7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8BC456972A5DD1F2008A4AF7 /* wolfssl_test_driver.c in Sources */, + 8BC456842A5DCC3D008A4AF7 /* ContentView.swift in Sources */, + 8BC456F32A5F20C8008A4AF7 /* simple_client_example.c in Sources */, + 8BC456822A5DCC3D008A4AF7 /* wolfssl_multiplatformApp.swift in Sources */, + 8BC456AB2A5DF7A6008A4AF7 /* test.c in Sources */, + 8BC456AE2A5DF7BA008A4AF7 /* benchmark.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 8BC4568B2A5DCC3F008A4AF7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 8BC4568C2A5DCC3F008A4AF7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 8BC4568E2A5DCC3F008A4AF7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = "wolfssl-multiplatform/wolfssl_multiplatform.entitlements"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = ""; + ENABLE_PREVIEWS = NO; + GCC_PREPROCESSOR_DEFINITIONS = "CERT_PATH=\\\"$PROJECT_DIR/../../../certs/wolfssl-website-ca.pem\\\""; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 16.4; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MARKETING_VERSION = 1.0; + OTHER_CFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = "wolfSSL.wolfssl-multiplatform"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "wolfssl-multiplatform/wolfssl-multiplatform-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3"; + }; + name = Debug; + }; + 8BC4568F2A5DCC3F008A4AF7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = "wolfssl-multiplatform/wolfssl_multiplatform.entitlements"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = ""; + ENABLE_PREVIEWS = NO; + GCC_PREPROCESSOR_DEFINITIONS = "CERT_PATH=\\\"$PROJECT_DIR/../../../certs/wolfssl-website-ca.pem\\\""; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 16.4; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MARKETING_VERSION = 1.0; + OTHER_CFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = "wolfSSL.wolfssl-multiplatform"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "wolfssl-multiplatform/wolfssl-multiplatform-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8BC456792A5DCC3D008A4AF7 /* Build configuration list for PBXProject "wolfssl-multiplatform" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8BC4568B2A5DCC3F008A4AF7 /* Debug */, + 8BC4568C2A5DCC3F008A4AF7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8BC4568D2A5DCC3F008A4AF7 /* Build configuration list for PBXNativeTarget "wolfssl-multiplatform" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8BC4568E2A5DCC3F008A4AF7 /* Debug */, + 8BC4568F2A5DCC3F008A4AF7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8BC456762A5DCC3D008A4AF7 /* Project object */; +} diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/AccentColor.colorset/Contents.json b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000000..eb87897008 --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/AppIcon.appiconset/Contents.json b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..532cd729c6 --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,63 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/Contents.json b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..73c00596a7 --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/ContentView.swift b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/ContentView.swift new file mode 100644 index 0000000000..6e452c5029 --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/ContentView.swift @@ -0,0 +1,47 @@ +/* ContentView.swift + * + * Copyright (C) 2006-2023 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +import SwiftUI + +struct ContentView: View { + + /* Call our test function in the initialization of the view */ + init() { + wolfssl_test(); + } + + + var body: some View { + VStack { + Image(systemName: "globe") + .imageScale(.large) + .foregroundColor(.accentColor) + Text("Hello, world!") + } + .padding() + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.c b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.c new file mode 100644 index 0000000000..b18d058da1 --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.c @@ -0,0 +1,149 @@ +/* simple_client_example.c + * + * Copyright (C) 2006-2023 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +#include "simple_client_example.h" + +#include +#include +#include +#include +#include + +#ifndef WOLFSSL_USER_SETTINGS +#include +#endif +#include + +#define SERVER_HOST "www.wolfssl.com" +#define SERVER_PORT "443" + +int simple_client_example(void) +{ + WOLFSSL_CTX* ctx; + WOLFSSL* ssl; + int sockfd, ret; + + /* Resolve the server address */ + struct addrinfo hints, *server_addr; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + + ret = getaddrinfo(SERVER_HOST, SERVER_PORT, &hints, &server_addr); + if (ret != 0) { + printf("Failed to resolve server address: %s\n", gai_strerror(ret)); + return 1; + } + + /* Create a TCP socket */ + sockfd = socket(server_addr->ai_family, + server_addr->ai_socktype, + server_addr->ai_protocol); + if (sockfd == -1) { + perror("Failed to create socket"); + freeaddrinfo(server_addr); + return 1; + } + + /* Connect to the server */ + ret = connect(sockfd, server_addr->ai_addr, server_addr->ai_addrlen); + if (ret == -1) { + perror("Failed to connect to server"); + freeaddrinfo(server_addr); + close(sockfd); + return 1; + } + + freeaddrinfo(server_addr); + + /* Initialize wolfSSL library */ + wolfSSL_Init(); + + /* Create a new SSL context */ + ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method()); + if (ctx == NULL) { + printf("Unable to create SSL context.\n"); + close(sockfd); + return 1; + } + + /* Load CA certificate into WOLFSSL_CTX + * NOTE: CERT_PATH macro is set relative to Xcode $(PROJECT_DIR) environment + * variable in the preprocessor macros section of the project build settings + * to avoid hardcoding a path in the source code. The CA cert is located at + * wolfssl/certs/wolfssl-website-ca.pem. */ + ret = wolfSSL_CTX_load_verify_locations(ctx, CERT_PATH, NULL); + if (ret != WOLFSSL_SUCCESS) { + printf("ERROR: failed to load %s, please check the file.\n", CERT_PATH); + wolfSSL_CTX_free(ctx); + close(sockfd); + return 1; + } + + /* Create a new SSL object */ + ssl = wolfSSL_new(ctx); + if (ssl == NULL) { + printf("Unable to create SSL object.\n"); + wolfSSL_CTX_free(ctx); + close(sockfd); + return 1; + } + + /* Attach the SSL object to the socket file descriptor */ + wolfSSL_set_fd(ssl, sockfd); + + /* Perform the SSL handshake */ + ret = wolfSSL_connect(ssl); + if (ret != SSL_SUCCESS) { + printf("SSL connection failed: %d\n", wolfSSL_get_error(ssl, ret)); + wolfSSL_free(ssl); + wolfSSL_CTX_free(ctx); + close(sockfd); + return 1; + } + + /* Send an HTTP request */ + const char* request = "GET / HTTP/1.1\r\nHost: www.wolfssl.com\r\n\r\n"; + ret = wolfSSL_write(ssl, request, (int)strlen(request)); + if (ret < 0) { + printf("Failed to send HTTP request.\n"); + } + + /* Receive and print the server's response */ + char buffer[1024]; + ret = wolfSSL_read(ssl, buffer, sizeof(buffer) - 1); + if (ret > 0) { + buffer[ret] = '\0'; + printf("Received %d bytes:\n%s\n", ret, buffer); + } else { + printf("Failed to receive server response.\n"); + } + + /* Clean up and close the connection */ + wolfSSL_shutdown(ssl); + wolfSSL_free(ssl); + wolfSSL_CTX_free(ctx); + wolfSSL_Cleanup(); + close(sockfd); + + return 0; +} + diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.h b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.h new file mode 100644 index 0000000000..ce88958216 --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.h @@ -0,0 +1,27 @@ +/* simple_client_example.h + * + * Copyright (C) 2006-2023 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +#ifndef simple_client_example_h +#define simple_client_example_h + +int simple_client_example(void); + +#endif /* simple_client_example_h */ diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl-multiplatform-Bridging-Header.h b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl-multiplatform-Bridging-Header.h new file mode 100644 index 0000000000..f232f13bd0 --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl-multiplatform-Bridging-Header.h @@ -0,0 +1,26 @@ +/* wolfssl-multiplatform-Bridging-Header.h + * + * Copyright (C) 2006-2023 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +/* + * Use this file to import your target's public headers that you would like to + * expose to Swift. + */ +#import "wolfssl_test_driver.h" diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatform.entitlements b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatform.entitlements new file mode 100644 index 0000000000..997a18c9c0 --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatform.entitlements @@ -0,0 +1,14 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + com.apple.security.network.client + + com.apple.security.network.server + + + diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatformApp.swift b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatformApp.swift new file mode 100644 index 0000000000..acf2a03aac --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatformApp.swift @@ -0,0 +1,32 @@ +/* wolfssl_multiplatformApp.swift + * + * Copyright (C) 2006-2023 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +import SwiftUI + +@main +struct wolfssl_multiplatformApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} + diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.c b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.c new file mode 100644 index 0000000000..50655c834e --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.c @@ -0,0 +1,62 @@ +/* wolfssl_test_driver.c + * + * Copyright (C) 2006-2023 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +#include "wolfssl_test_driver.h" + +#ifndef WOLFSSL_USER_SETTINGS +#include +#endif +#include + +#include "test.h" +#include "benchmark.h" +#include "simple_client_example.h" + +typedef struct test_func_args { + int argc; + char** argv; + int return_code; +} test_func_args; + + + +void wolfssl_test(void) +{ + int ret; + test_func_args args = {0}; + +#ifdef WC_RNG_SEED_CB + wc_SetSeed_Cb(wc_GenerateSeed); +#endif + + printf("Run wolfCrypt Test:\n"); + ret = wolfcrypt_test(&args); + printf("\nResult of wolfcrypt_test() = %d\n\n", ret); + + printf("Run wolfCrypt Benchmark:\n"); + ret = benchmark_test(&args); + printf("\nResult of benchmark_test() = %d\n\n", ret); + + printf("Run simple client test:\n"); + ret = simple_client_example(); + printf("\nResult of simple_client_test() = %d\n\n", ret); + +} diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.h b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.h new file mode 100644 index 0000000000..a3104e64ef --- /dev/null +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.h @@ -0,0 +1,27 @@ +/* wolfssl_test_driver.h + * + * Copyright (C) 2006-2023 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +#ifndef wolfssl_test_driver_h +#define wolfssl_test_driver_h + +void wolfssl_test(void); + +#endif /* wolfssl_test_driver_h */ diff --git a/IDE/include.am b/IDE/include.am index 5cb88e1870..dcdbb2c63f 100644 --- a/IDE/include.am +++ b/IDE/include.am @@ -55,6 +55,7 @@ include IDE/Espressif/include.am include IDE/STARCORE/include.am include IDE/MDK5-ARM/include.am include IDE/SimplicityStudio/include.am +include IDE/apple-universal/include.am EXTRA_DIST+= IDE/IAR-EWARM IDE/MDK-ARM IDE/MYSQL IDE/LPCXPRESSO IDE/HEXIWEAR IDE/Espressif EXTRA_DIST+= IDE/OPENSTM32/README.md