From 61bce5e058ec0d6e457ade1b53e64a7288c23797 Mon Sep 17 00:00:00 2001 From: gojimmypi Date: Tue, 8 Apr 2025 11:04:43 +0200 Subject: [PATCH] Improve CSharp Examples --- .github/workflows/visual-studio.yml | 92 ++ .wolfssl_known_macro_extras | 2 + wolfssl/sniffer.h | 3 +- wolfssl/wolfcrypt/curve25519.h | 1 - wolfssl/wolfcrypt/ed25519.h | 1 - wrapper/CSharp/README.md | 218 ++++- wrapper/CSharp/cpp.hint | 7 + wrapper/CSharp/include.am | 2 + wrapper/CSharp/user_settings.h | 5 +- wrapper/CSharp/wolfCrypt-Test/App.config | 16 +- .../wolfCrypt-Test/wolfCrypt-Test.csproj | 245 ++--- .../CSharp/wolfSSL-DTLS-PSK-Server/App.config | 6 +- .../wolfSSL-DTLS-PSK-Server.cs | 41 +- .../wolfSSL-DTLS-PSK-Server.csproj | 6 +- wrapper/CSharp/wolfSSL-DTLS-Server/App.config | 6 +- .../wolfSSL-DTLS-Server.cs | 37 +- .../wolfSSL-DTLS-Server.csproj | 6 +- .../wolfSSL-Example-IOCallbacks/App.config | 6 +- .../wolfSSL-Example-IOCallbacks.cs | 38 +- .../wolfSSL-Example-IOCallbacks.csproj | 6 +- wrapper/CSharp/wolfSSL-TLS-Client/App.config | 6 +- .../wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs | 51 +- .../wolfSSL-TLS-Client.csproj | 6 +- .../CSharp/wolfSSL-TLS-PSK-Client/App.config | 6 +- .../wolfSSL-TLS-PSK-Client.cs | 35 +- .../wolfSSL-TLS-PSK-Client.csproj | 6 +- .../CSharp/wolfSSL-TLS-PSK-Server/App.config | 8 +- .../wolfSSL-TLS-PSK-Server.cs | 39 +- .../wolfSSL-TLS-PSK-Server.csproj | 6 +- wrapper/CSharp/wolfSSL-TLS-Server/App.config | 6 +- .../wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs | 47 +- .../wolfSSL-TLS-Server.csproj | 9 +- .../wolfSSL-TLS-ServerThreaded/App.config | 6 +- .../wolfSSL-TLS-ServerThreaded.cs | 28 +- .../wolfSSL-TLS-ServerThreaded.csproj | 6 +- wrapper/CSharp/wolfSSL_CSharp.sln | 12 +- .../wolfSSL_CSharp/Properties/AssemblyInfo.cs | 4 +- wrapper/CSharp/wolfSSL_CSharp/wolfCrypt.cs | 13 +- wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs | 409 +++++++- .../wolfSSL_CSharp/wolfSSL_CSharp.csproj | 12 +- wrapper/CSharp/wolfssl.vcxproj | 916 +++++++++--------- .../wolfSSL_CSharp-Clients.sln | 312 ++++++ 42 files changed, 1899 insertions(+), 788 deletions(-) create mode 100644 .github/workflows/visual-studio.yml create mode 100644 wrapper/CSharp/cpp.hint create mode 100644 wrapper/CSharp/wolfssl_clients/wolfSSL_CSharp-Clients.sln diff --git a/.github/workflows/visual-studio.yml b/.github/workflows/visual-studio.yml new file mode 100644 index 0000000000..1c78353be3 --- /dev/null +++ b/.github/workflows/visual-studio.yml @@ -0,0 +1,92 @@ +name: Build for .NET 3.5 + +# START OF COMMON SECTION +on: + push: + branches: [ 'master', 'main', 'release/**' ] + pull_request: + branches: [ '*' ] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +# END OF COMMON SECTION + +jobs: + build: + if: github.repository_owner == 'wolfssl' + runs-on: windows-2019 # .NET 3.5 is available here + + steps: + # Checkout PR branch (supports both forks and local PRs) + - name: Checkout Repository (PR branch or push branch) + uses: actions/checkout@v3 + with: + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ github.event.pull_request.head.ref || github.ref_name }} + + # Checkout wolfSSL (PR branch if from fork, master if push) + - name: Checkout wolfSSL (PR branch or master) + uses: actions/checkout@v3 + with: + repository: ${{ github.event.pull_request.head.repo.full_name || 'wolfssl/wolfssl' }} # Pull from fork if PR exists + ref: ${{ github.event.pull_request.head.ref || 'master' }} # Use PR branch if available, otherwise master + path: wolfssl # Clone wolfSSL into "wolfssl" subdirectory + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1 + + # wolfSSL core + - name: Build wolfSSL (DLL Debug, x64) + working-directory: wolfssl + run: | + msbuild wolfssl.vcxproj /p:Configuration="DLL Debug" /p:Platform=x64 /p:PlatformToolset=v142 /m /verbosity:normal + shell: cmd + + # C# Wrapper + - name: Build wolfSSL_CSharp + working-directory: wrapper/CSharp/wolfSSL_CSharp + run: msbuild wolfSSL_CSharp.csproj /p:TargetFrameworkVersion=v3.5 + + # wolfCrypt-Test + - name: Build wolfCrypt-Test + working-directory: wrapper/CSharp/wolfCrypt-Test + run: msbuild wolfCrypt-Test.csproj /p:TargetFrameworkVersion=v3.5 + + # DTLS + - name: Build wolfSSL-DTLS-Server + working-directory: wrapper/CSharp/wolfSSL-DTLS-Server + run: msbuild wolfSSL-DTLS-Server.csproj /p:TargetFrameworkVersion=v3.5 + + # DTLS-PSK + - name: Build wolfSSL-DTLS-PSK-Server + working-directory: wrapper/CSharp/wolfSSL-DTLS-PSK-Server + run: msbuild wolfSSL-DTLS-PSK-Server.csproj /p:TargetFrameworkVersion=v3.5 + + # TLS + - name: Build wolfSSL-TLS-Client + working-directory: wrapper/CSharp/wolfSSL-TLS-Client + run: msbuild wolfSSL-TLS-Client.csproj /p:TargetFrameworkVersion=v3.5 + + - name: Build wolfSSL-TLS-Server + working-directory: wrapper/CSharp/wolfSSL-TLS-Server + run: msbuild wolfSSL-TLS-Server.csproj /p:TargetFrameworkVersion=v3.5 + + - name: Build wolfSSL-TLS-ServerThreaded + working-directory: wrapper/CSharp/wolfSSL-TLS-ServerThreaded + run: msbuild wolfSSL-TLS-ServerThreaded.csproj /p:TargetFrameworkVersion=v3.5 + + # TLS PSK + - name: Build wolfSSL-TLS-PSK-Client + working-directory: wrapper/CSharp/wolfSSL-TLS-PSK-Client + run: msbuild wolfSSL-TLS-PSK-Client.csproj /p:TargetFrameworkVersion=v3.5 + + - name: Build wolfSSL-TLS-PSK-Server + working-directory: wrapper/CSharp/wolfSSL-TLS-PSK-Server + run: msbuild wolfSSL-TLS-PSK-Server.csproj /p:TargetFrameworkVersion=v3.5 + + # Example-IOCallbacks + - name: Build wolfSSL-Example-IOCallbacks + working-directory: wrapper/CSharp/wolfSSL-Example-IOCallbacks + run: msbuild wolfSSL-Example-IOCallbacks.csproj /p:TargetFrameworkVersion=v3.5 diff --git a/.wolfssl_known_macro_extras b/.wolfssl_known_macro_extras index 0dc46fcab6..5a278c64ca 100644 --- a/.wolfssl_known_macro_extras +++ b/.wolfssl_known_macro_extras @@ -164,6 +164,7 @@ DILITHIUM_MUL_Q_SLOW DILITHIUM_MUL_SLOW DILITHIUM_USE_HINT_CT DTLS_RECEIVEFROM_NO_TIMEOUT_ON_INVALID_PEER +Debug ECCSI_ORDER_MORE_BITS_THAN_PRIME ECC_DUMP_OID ECDHE_SIZE @@ -418,6 +419,7 @@ RTC_ALARMSUBSECONDMASK_ALL RTE_CMSIS_RTOS_RTX RTOS_MODULE_NET_AVAIL RTPLATFORM +Release SA_INTERRUPT SCEKEY_INSTALLED SHA256_MANY_REGISTERS diff --git a/wolfssl/sniffer.h b/wolfssl/sniffer.h index 929fcdc9de..ad98dc3713 100644 --- a/wolfssl/sniffer.h +++ b/wolfssl/sniffer.h @@ -31,12 +31,11 @@ #include #endif - #ifdef _WIN32 #ifdef SSL_SNIFFER_EXPORTS #define SSL_SNIFFER_API __declspec(dllexport) #else - #define SSL_SNIFFER_API __declspec(dllimport) + #define SSL_SNIFFER_API #endif #else #define SSL_SNIFFER_API diff --git a/wolfssl/wolfcrypt/curve25519.h b/wolfssl/wolfcrypt/curve25519.h index 79fb6d9af3..dc294ecc86 100644 --- a/wolfssl/wolfcrypt/curve25519.h +++ b/wolfssl/wolfcrypt/curve25519.h @@ -165,7 +165,6 @@ curve25519_key* wc_curve25519_new(void* heap, int devId, int *result_code); WOLFSSL_API int wc_curve25519_delete(curve25519_key* key, curve25519_key** key_p); #endif -WOLFSSL_API /* raw key helpers */ WOLFSSL_API diff --git a/wolfssl/wolfcrypt/ed25519.h b/wolfssl/wolfcrypt/ed25519.h index 8dc0fc1184..f7367b547f 100644 --- a/wolfssl/wolfcrypt/ed25519.h +++ b/wolfssl/wolfcrypt/ed25519.h @@ -187,7 +187,6 @@ ed25519_key* wc_ed25519_new(void* heap, int devId, int *result_code); WOLFSSL_API int wc_ed25519_delete(ed25519_key* key, ed25519_key** key_p); #endif -WOLFSSL_API #ifdef HAVE_ED25519_KEY_IMPORT WOLFSSL_API diff --git a/wrapper/CSharp/README.md b/wrapper/CSharp/README.md index 537e6cc9b4..0293798b69 100644 --- a/wrapper/CSharp/README.md +++ b/wrapper/CSharp/README.md @@ -28,19 +28,219 @@ need to open a new solution `wolfSSL_CSharp.sln` located in `wrapper\CSharp\wolf Select the CPU type, configuration, and target file. select `Build` and either `Rebuild Solution` or `Build Solution`. +### Visual Studio Build Configurations + +In addition to the Configuration and Platform build options, Visual Studio has a `Platform Toolset` option in the (C not C#) `wolfssl` project file. +This can be found in the (Right-click on wolfssl project) `Property pages - General`. + +A missing Platform Toolset is assumed to be Visual Studio 2010. Click the drop-down to see options available. + +```text + v143 +``` + +| Visual Studio Version | Internal Version | Platform Toolset | +|-----------------------|------------------|------------------| +| Visual Studio 2010 | 10.0 | v100 | +| Visual Studio 2012 | 11.0 | v110 | +| Visual Studio 2013 | 12.0 | v120 | +| Visual Studio 2015 | 14.0 | v140 | +| Visual Studio 2017 | 15.0 | v141 | +| Visual Studio 2019 | 16.0 | v142 | +| Visual Studio 2022 | 17.0 | v143 | + +The `wolfssl` C project can also have the Toolset modified by right-clicking on the project and selecting "Retarget Projects". + +Retargeting typically only offers to upgrade to the latest Platform Toolset, so the `wolfssl.vcxproj` file +will need to be manually edited if older versions are required. + +### Debugging Native Code + +Right-click on the `wolfSSL_CSharp` project, select `Properties` and +navigate to the `Debug` panel. + +Be sure to check the box under `Debugger engines`: [x] `Enable native code debugging`. + +This will allow single-step debugging into the native wolfSSL C library. + +Do this also for the startup project being debugged. + +If the error `Interop debugging is not supported` is encountered, +check which version of the .NET framework is being used. +Only 4.x or later supports native code debugging from a C# app. + +See also: + +https://learn.microsoft.com/en-us/visualstudio/debugger/debugging-native-code + +### Calling Convention + +The wolfSSL functions are wrapped like this: + +``` +[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)] +private extern static int wolfSSL_Init(); +``` + +Where `wolfssl_dll` is a constant compile-time string that points to the `wolfssl.dll` file. + +### Troubleshooting Windows DLL + +The `wolfssl.dll` file is created with the `DLL Debug` and `DLL Release` configurations +and is typically compiled to: + +``` +C:\workspace\wolfssl-%USERNAME$\wrapper\CSharp\Debug\x64\wolfssl.dll +``` + +From a developer command prompt: + +``` +dumpbin /EXPORTS C:\workspace\wolfssl-$USER\wrapper\CSharp\Debug\x64\wolfssl.dll +``` + +There should be a long list of functions. If not, be sure to build with `WOLFSSL_DLL` (should be automatically included with DLL Debug/Release configurations). + +See the project file `PreprocessorDefinitions` section: + +``` +BUILDING_WOLFSSL;WOLFSSL_DLL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) +``` + +If wolfSSL was _not_ compiled with `WOLFSSL_DLL` the `Unable to find an entry point` will be encountered: + +``` +wolfssl init error System.EntryPointNotFoundException: Unable to find an entry point named 'wolfSSL_Init' in DLL 'wolfssl.dll'. + at wolfSSL.CSharp.wolfssl.wolfSSL_Init() + at wolfSSL.CSharp.wolfssl.Init() in C:\workspace\wolfssl-%USERNAME%\wrapper\CSharp\wolfSSL_CSharp\wolfSSL.cs:line nnn +Calling ctx Init from wolfSSL +``` + +Note the `WOLFSSL_DLL` is used in the wolfssl `wolfssl/wolfssl/wolfcrypt/visibility.h` and defines the `WOLFSSL_API` like this: + +``` +#define WOLFSSL_API __declspec(dllexport) +``` + +Only the wolfSSL function declarations decorated with this tag will be visible ion the DLL. + +#### Finding the wolfssl.dll + +The most common problem encountered on Windows is the DLL location. + +If not developing wolfSSL for Windows, one option is to copy the `wolfssl.dll` to `C:\Windows\System32\`. + +Another option is to add to the system environment path or your user environment path: + +``` +set PATH=%PATH%;C:\path\to\your\wolfssl.dll +``` + +#### Check Architecture (x86 vs x64) + +Your C# application must match the architecture of wolfssl.dll: + +- If your C# app is x64, wolfssl.dll must be 64-bit. +- If your C# app is x86, wolfssl.dll must be 32-bit. + +#### Ensure wolfssl.dll is Unblocked + +If you downloaded wolfssl.dll from the Internet, Windows may block it. + +Right-click wolfssl.dll, go to Properties, and check Unblock under Security. + + +## Linux (Ubuntu) using WSL + +The Microsoft Windows Subsystem for Linux cam be used for wolfSSL. + +```bash +sudo +sudo apt-get update +sudo apt-get upgrade +sudo apt install -y build-essential autoconf automake libtool pkg-config + +export WORKSPACE="/mnt/c/workspace" +export WOLFSSL_ROOT="$WORKSPACE/wolfssl-$USER" + +cd "WOLFSSL_ROOT" +``` + +When using a git repository, run `autogen.sh`: + +``` +cd "$WOLFSSL_ROOT" +./autogen.sh +``` + +### Build wolfSSL and install it system-wide + +To have a single instance of wolfSSL: + +``` +./configure +make +make check # (optional, but highly recommended) +sudo make install +``` + +### Build wolfSSL and install to arbitrary directory + +To have an isolated instance of wolfSSL, in this case `$HOME/wolfssl-install-psk`: + +```bash +make clean +make distclean + +rm -rf "$HOME/wolfssl-install-psk" + +./configure --enable-all --disable-crypttests \ + --disable-examples \ + --enable-opensslall --enable-opensslextra \ + --enable-tls13 --enable-dtls13 --enable-dtls --enable-psk \ + CFLAGS="-DWOLFSSL_STATIC_PSK" --enable-shared \ + --prefix="$HOME/wolfssl-install-psk" + +make -j$(nproc) +make install +``` + + + +### Compile specific example in WSL + +```bash +# Optionally fetch additional examples +git clone https://github.com/wolfSSL/wolfssl-examples.git "$WORKSPACE/wolfssl-examples-$USER" +cd "$WORKSPACE/wolfssl-examples-$USER" + +THIS_EXAMPLE="client-dtls-psk" + +export WOLFSSL_DIR="$HOME/wolfssl-install-psk" +export CFLAGS="-I$WOLFSSL_DIR/include" +export LDFLAGS="-L$WOLFSSL_DIR/lib" + +export LD_LIBRARY_PATH="$HOME/wolfssl-install-psk/lib:$LD_LIBRARY_PATH" + +gcc -o "$THIS_EXAMPLE" "$THIS_EXAMPLE".c \ + -I$HOME/wolfssl-install-psk/include \ + -L$HOME/wolfssl-install-psk/lib -Wl,-rpath=$HOME/wolfssl-install-psk/lib -lwolfssl -lm +``` + ## Linux (Ubuntu) using mono Prerequisites for linux: -``` +```bash apt-get update apt-get upgrade apt-get install mono-complete ``` -### Build wolfSSL and install +### Build wolfSSL and install system-wide -``` +```bash ./autogen.sh ./configure --enable-keygen --enable-eccencrypt --enable-ed25519 --enable-curve25519 --enable-aesgcm make @@ -52,9 +252,9 @@ sudo make install From the `wrapper/CSharp` directory (`cd wrapper/CSharp`): -Compile wolfCrypt test: +Compile wolfCrypt test with mono: -``` +```bash mcs wolfCrypt-Test/wolfCrypt-Test.cs wolfSSL_CSharp/wolfCrypt.cs -OUT:wolfcrypttest.exe mono wolfcrypttest.exe ``` @@ -63,15 +263,15 @@ mono wolfcrypttest.exe From the `wrapper/CSharp` directory (`cd wrapper/CSharp`): -Compile server: +Compile server with mono: -``` +```bash mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs -OUT:server.exe ``` -Compile client: +Compile client with mono: -``` +```bash mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs -OUT:client.exe ``` diff --git a/wrapper/CSharp/cpp.hint b/wrapper/CSharp/cpp.hint new file mode 100644 index 0000000000..9e9e1fd0d2 --- /dev/null +++ b/wrapper/CSharp/cpp.hint @@ -0,0 +1,7 @@ +// Hint files help the Visual Studio IDE interpret Visual C++ identifiers +// such as names of functions and macros. +// For more information see https://go.microsoft.com/fwlink/?linkid=865984 +#define WOLFSSL_API +#define WOLFSSL_API __declspec(dllexport) +#define WOLFSSL_API __attribute__ ((visibility("default"))) + diff --git a/wrapper/CSharp/include.am b/wrapper/CSharp/include.am index ecd70d015e..05879bb680 100644 --- a/wrapper/CSharp/include.am +++ b/wrapper/CSharp/include.am @@ -1,4 +1,5 @@ # wolfSSL CSharp wrapper files +EXTRA_DIST+= wrapper/CSharp/cpp.hint EXTRA_DIST+= wrapper/CSharp/README.md EXTRA_DIST+= wrapper/CSharp/wolfSSL-DTLS-PSK-Server/App.config EXTRA_DIST+= wrapper/CSharp/wolfSSL-DTLS-PSK-Server/Properties/AssemblyInfo.cs @@ -47,3 +48,4 @@ EXTRA_DIST+= wrapper/CSharp/wolfCrypt-Test/App.config EXTRA_DIST+= wrapper/CSharp/wolfCrypt-Test/Properties/AssemblyInfo.cs EXTRA_DIST+= wrapper/CSharp/wolfCrypt-Test/wolfCrypt-Test.cs EXTRA_DIST+= wrapper/CSharp/wolfCrypt-Test/wolfCrypt-Test.csproj +EXTRA_DIST+= wrapper/CSharp/wolfssl_clients/wolfSSL_CSharp-Clients.sln diff --git a/wrapper/CSharp/user_settings.h b/wrapper/CSharp/user_settings.h index 21fb7b11c6..67084081f6 100644 --- a/wrapper/CSharp/user_settings.h +++ b/wrapper/CSharp/user_settings.h @@ -126,8 +126,9 @@ #endif #endif -/* Debug logging */ -#if 1 +/* Debug logging; + * DLL_DEBUG is a preprocessor for the "DLL Debug" build config */ +#if defined(DLL_DEBUG) || defined(Debug) || defined(DEBUG) #define DEBUG_WOLFSSL #else /* #define NO_ERROR_STRINGS */ diff --git a/wrapper/CSharp/wolfCrypt-Test/App.config b/wrapper/CSharp/wolfCrypt-Test/App.config index 4bfa005618..912a4e01f5 100644 --- a/wrapper/CSharp/wolfCrypt-Test/App.config +++ b/wrapper/CSharp/wolfCrypt-Test/App.config @@ -1,6 +1,10 @@ - - - - - - + + + + + + + + + + diff --git a/wrapper/CSharp/wolfCrypt-Test/wolfCrypt-Test.csproj b/wrapper/CSharp/wolfCrypt-Test/wolfCrypt-Test.csproj index 647d7ce7bd..565bbf4fd4 100644 --- a/wrapper/CSharp/wolfCrypt-Test/wolfCrypt-Test.csproj +++ b/wrapper/CSharp/wolfCrypt-Test/wolfCrypt-Test.csproj @@ -1,123 +1,124 @@ - - - - - Debug - AnyCPU - {A4F4A244-1306-47F4-A168-31F78D7362FA} - Exe - Properties - wolfCrypt_Test - wolfCrypt-Test - v4.8 - 512 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - AnyCPU - true - full - false - $(SolutionDir)$(Configuration)\$(Platform)\ - DEBUG;TRACE - prompt - 3 - - - AnyCPU - pdbonly - true - $(SolutionDir)$(Configuration)\$(Platform)\ - TRACE - prompt - 4 - - - - - - true - $(SolutionDir)$(Configuration)\$(Platform)\ - DEBUG;TRACE - 4 - full - x64 - prompt - MinimumRecommendedRules.ruleset - true - - - $(SolutionDir)$(Configuration)\$(Platform)\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - true - - - - - - - - - - - - - - - - - - - {52609808-0418-46d3-8e17-141927a1a39a} - wolfSSL_CSharp - - - - - False - Microsoft .NET Framework 4.5 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - - - - - - + + + + + Debug + AnyCPU + {A4F4A244-1306-47F4-A168-31F78D7362FA} + Exe + Properties + wolfCrypt_Test + wolfCrypt-Test + v3.5 + 512 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + AnyCPU + true + full + false + $(SolutionDir)$(Configuration)\$(Platform)\ + DEBUG;TRACE + prompt + 3 + + + AnyCPU + pdbonly + true + $(SolutionDir)$(Configuration)\$(Platform)\ + TRACE + prompt + 4 + + + + + + true + $(SolutionDir)$(Configuration)\$(Platform)\ + DEBUG;TRACE + 4 + full + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + $(SolutionDir)$(Configuration)\$(Platform)\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + + + + + + + + + + + + + + + + + {52609808-0418-46d3-8e17-141927a1a39a} + wolfSSL_CSharp + + + + + False + Microsoft .NET Framework 4.5 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + \ No newline at end of file diff --git a/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/App.config b/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/App.config index 8a99d30db7..912a4e01f5 100755 --- a/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/App.config +++ b/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/App.config @@ -1,6 +1,10 @@ - + + + + + diff --git a/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.cs b/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.cs index eaf9c85b42..5b46f16808 100644 --- a/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.cs +++ b/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.cs @@ -84,7 +84,7 @@ public static void Main(string[] args) if (fileCert == "" || fileKey == "" || dhparam.Length == 0) { Console.WriteLine("Platform not supported"); - return; + Environment.Exit(1); } wolfssl.psk_delegate psk_cb = new wolfssl.psk_delegate(my_psk_server_cb); @@ -92,14 +92,23 @@ public static void Main(string[] args) StringBuilder buff = new StringBuilder(1024); StringBuilder reply = new StringBuilder("Hello, this is the wolfSSL C# wrapper"); - wolfssl.Init(); + Console.WriteLine("Initializing wolfssl..."); + if (wolfssl.Init() == wolfssl.SUCCESS) + { + Console.WriteLine("Successfully initialized wolfssl"); + } + else + { + Console.WriteLine("ERROR: Failed to initialize wolfssl"); + Environment.Exit(1); + } Console.WriteLine("Calling ctx Init from wolfSSL"); ctx = wolfssl.CTX_dtls_new(wolfssl.useDTLSv1_2_server()); if (ctx == IntPtr.Zero) { Console.WriteLine("Error creating ctx structure"); - return; + Environment.Exit(1); } Console.WriteLine("Finished init of ctx .... now load in cert and key"); @@ -108,13 +117,13 @@ public static void Main(string[] args) { Console.WriteLine("Could not find cert or key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (!File.Exists(dhparam.ToString())) { Console.WriteLine("Could not find dh file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } @@ -122,7 +131,7 @@ public static void Main(string[] args) { Console.WriteLine("Error setting cert file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } @@ -130,7 +139,7 @@ public static void Main(string[] args) { Console.WriteLine("Error setting key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } @@ -140,7 +149,7 @@ public static void Main(string[] args) { Console.WriteLine("Error setting hint"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } wolfssl.CTX_set_psk_server_callback(ctx, psk_cb); @@ -153,7 +162,7 @@ public static void Main(string[] args) { Console.WriteLine("Failed to set cipher suite"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } IPAddress ip = IPAddress.Parse("0.0.0.0"); @@ -167,7 +176,7 @@ public static void Main(string[] args) Console.WriteLine("Error creating ssl object"); udp.Close(); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.SetTmpDH_file(ssl, dhparam, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) @@ -176,7 +185,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); udp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } if (wolfssl.set_dtls_fd(ssl, udp, ep) != wolfssl.SUCCESS) @@ -184,7 +193,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); udp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } if (wolfssl.accept(ssl) != wolfssl.SUCCESS) @@ -192,7 +201,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); udp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } /* print out results of TLS/SSL accept */ @@ -213,7 +222,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); udp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } Console.WriteLine(buff); @@ -223,12 +232,14 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); udp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } Console.WriteLine("At the end freeing stuff"); wolfssl.shutdown(ssl); udp.Close(); clean(ssl, ctx); + + Environment.Exit(0); } } diff --git a/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.csproj b/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.csproj index 5bf4e8c8e0..dc0b789f4c 100755 --- a/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.csproj +++ b/wrapper/CSharp/wolfSSL-DTLS-PSK-Server/wolfSSL-DTLS-PSK-Server.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Properties wolfSSL_DTLS_PSK_Server wolfSSL-DTLS-PSK-Server - v4.8 + v3.5 512 @@ -85,4 +85,4 @@ --> - + \ No newline at end of file diff --git a/wrapper/CSharp/wolfSSL-DTLS-Server/App.config b/wrapper/CSharp/wolfSSL-DTLS-Server/App.config index 8a99d30db7..912a4e01f5 100755 --- a/wrapper/CSharp/wolfSSL-DTLS-Server/App.config +++ b/wrapper/CSharp/wolfSSL-DTLS-Server/App.config @@ -1,6 +1,10 @@ - + + + + + diff --git a/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.cs b/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.cs index ba3075eb13..9afc53d6b0 100644 --- a/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.cs +++ b/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.cs @@ -64,7 +64,7 @@ public static void Main(string[] args) if (fileCert == "" || fileKey == "" || dhparam.Length == 0) { Console.WriteLine("Platform not supported"); - return; + Environment.Exit(1); } StringBuilder buff = new StringBuilder(1024); @@ -73,7 +73,16 @@ public static void Main(string[] args) //example of function used for setting logging wolfssl.SetLogging(standard_log); - wolfssl.Init(); + Console.WriteLine("Initializing wolfssl..."); + if (wolfssl.Init() == wolfssl.SUCCESS) + { + Console.WriteLine("Successfully initialized wolfssl"); + } + else + { + Console.WriteLine("ERROR: Failed to initialize wolfssl"); + Environment.Exit(1); + } Console.WriteLine("Calling ctx Init from wolfSSL"); ctx = wolfssl.CTX_dtls_new(wolfssl.useDTLSv1_2_server()); @@ -81,7 +90,7 @@ public static void Main(string[] args) { Console.WriteLine("Error creating ctx structure"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } Console.WriteLine("Finished init of ctx .... now load in cert and key"); @@ -89,13 +98,13 @@ public static void Main(string[] args) { Console.WriteLine("Could not find cert or key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (!File.Exists(dhparam.ToString())) { Console.WriteLine("Could not find dh file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } @@ -103,7 +112,7 @@ public static void Main(string[] args) { Console.WriteLine("Error setting cert file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } @@ -111,7 +120,7 @@ public static void Main(string[] args) { Console.WriteLine("Error setting key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } short minDhKey = 128; @@ -127,7 +136,7 @@ public static void Main(string[] args) { Console.WriteLine("Error creating ssl object"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.SetTmpDH_file(ssl, dhparam, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) @@ -136,7 +145,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); udp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } if (wolfssl.set_dtls_fd(ssl, udp, ep) != wolfssl.SUCCESS) @@ -144,7 +153,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); udp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } if (wolfssl.accept(ssl) != wolfssl.SUCCESS) @@ -152,7 +161,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); udp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } /* print out results of TLS/SSL accept */ @@ -173,7 +182,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); udp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } Console.WriteLine(buff); @@ -183,12 +192,14 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); udp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } Console.WriteLine("At the end freeing stuff"); wolfssl.shutdown(ssl); udp.Close(); clean(ssl, ctx); + + Environment.Exit(0); } } diff --git a/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.csproj b/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.csproj index e0c4a57ea3..d913ab9ff7 100755 --- a/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.csproj +++ b/wrapper/CSharp/wolfSSL-DTLS-Server/wolfSSL-DTLS-Server.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Properties wolfSSL_DTLS_Server wolfSSL-DTLS-Server - v4.8 + v3.5 512 @@ -86,4 +86,4 @@ --> - + \ No newline at end of file diff --git a/wrapper/CSharp/wolfSSL-Example-IOCallbacks/App.config b/wrapper/CSharp/wolfSSL-Example-IOCallbacks/App.config index 8a99d30db7..912a4e01f5 100755 --- a/wrapper/CSharp/wolfSSL-Example-IOCallbacks/App.config +++ b/wrapper/CSharp/wolfSSL-Example-IOCallbacks/App.config @@ -1,6 +1,10 @@ - + + + + + diff --git a/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.cs b/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.cs index d1edcbcd37..0bbb2f19e3 100644 --- a/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.cs +++ b/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.cs @@ -1,4 +1,4 @@ -/* wolfSSL-Example-IOCallbacks.cs +/* wolfSSL-Example-IOCallbacks.cs * * Copyright (C) 2006-2025 wolfSSL Inc. * @@ -23,10 +23,7 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; using System.Net; using System.Net.Sockets; using System.Runtime.InteropServices; @@ -223,20 +220,29 @@ static void Main(string[] args) if (fileCert == "" || fileKey == "" || dhparam.Length == 0) { Console.WriteLine("Platform not supported"); - return; + Environment.Exit(1); } StringBuilder buff = new StringBuilder(1024); StringBuilder reply = new StringBuilder("Hello, this is the wolfSSL C# wrapper"); - wolfssl.Init(); + Console.WriteLine("Initializing wolfssl..."); + if (wolfssl.Init() == wolfssl.SUCCESS) + { + Console.WriteLine("Successfully initialized wolfssl"); + } + else + { + Console.WriteLine("ERROR: Failed to initialize wolfssl"); + Environment.Exit(1); + } Console.WriteLine("Calling ctx Init from wolfSSL"); ctx = wolfssl.CTX_new(wolfssl.useTLSv1_2_server()); if (ctx == IntPtr.Zero) { Console.WriteLine("Error creating ctx structure"); - return; + Environment.Exit(1); } Console.WriteLine("Finished init of ctx .... now load in cert and key"); @@ -244,27 +250,27 @@ static void Main(string[] args) { Console.WriteLine("Could not find cert or key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (!File.Exists(dhparam.ToString())) { Console.WriteLine("Could not find dh file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.CTX_use_certificate_file(ctx, fileCert, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) { Console.WriteLine("Error in setting cert file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.CTX_use_PrivateKey_file(ctx, fileKey, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) { Console.WriteLine("Error in setting key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } wolfssl.CTX_set_verify(ctx, wolfssl.SSL_VERIFY_PEER, verify_cb); @@ -291,7 +297,7 @@ delegate memory is allocated when calling SetIO**** function and freed with ctx Console.WriteLine(wolfssl.get_error(ssl)); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } if (wolfssl.accept(ssl) != wolfssl.SUCCESS) @@ -300,7 +306,7 @@ delegate memory is allocated when calling SetIO**** function and freed with ctx Console.WriteLine(wolfssl.get_error(ssl)); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } /* print out results of TLS/SSL accept */ @@ -313,7 +319,7 @@ delegate memory is allocated when calling SetIO**** function and freed with ctx Console.WriteLine("Error in read"); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } Console.WriteLine(buff); @@ -322,12 +328,14 @@ delegate memory is allocated when calling SetIO**** function and freed with ctx Console.WriteLine("Error in write"); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } wolfssl.shutdown(ssl); fd.Close(); tcp.Stop(); clean(ssl, ctx); + + Environment.Exit(0); } } diff --git a/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.csproj b/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.csproj index dc57d74f3b..fe7da024de 100755 --- a/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.csproj +++ b/wrapper/CSharp/wolfSSL-Example-IOCallbacks/wolfSSL-Example-IOCallbacks.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Properties wolfSSL_Example_IOCallbacks wolfSSL-Example-IOCallbacks - v4.8 + v3.5 512 @@ -82,4 +82,4 @@ --> - + \ No newline at end of file diff --git a/wrapper/CSharp/wolfSSL-TLS-Client/App.config b/wrapper/CSharp/wolfSSL-TLS-Client/App.config index 8a99d30db7..912a4e01f5 100644 --- a/wrapper/CSharp/wolfSSL-TLS-Client/App.config +++ b/wrapper/CSharp/wolfSSL-TLS-Client/App.config @@ -1,6 +1,10 @@ - + + + + + diff --git a/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs b/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs index d327b65341..28c52d222c 100644 --- a/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs +++ b/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs @@ -90,38 +90,47 @@ public static void Main(string[] args) if (caCert == "" || dhparam.Length == 0) { Console.WriteLine("Platform not supported."); - return; + return; } StringBuilder buff = new StringBuilder(1024); StringBuilder reply = new StringBuilder("Hello, this is the wolfSSL C# wrapper"); - //example of function used for setting logging + /* example of function used for setting logging */ wolfssl.SetLogging(standard_log); - wolfssl.Init(); + Console.WriteLine("Initializing wolfssl..."); + if (wolfssl.Init() == wolfssl.SUCCESS) + { + Console.WriteLine("Successfully initialized wolfssl"); + } + else + { + Console.WriteLine("ERROR: Failed to initialize wolfssl"); + Environment.Exit(1); + } Console.WriteLine("Calling ctx Init from wolfSSL"); ctx = wolfssl.CTX_new(wolfssl.usev23_client()); if (ctx == IntPtr.Zero) { Console.WriteLine("Error in creating ctx structure"); - return; + Environment.Exit(1); } Console.WriteLine("Finished init of ctx .... now load in CA"); if (!File.Exists(caCert)) { - Console.WriteLine("Could not find CA cert file"); + Console.WriteLine("Could not find CA cert file: " + Path.GetFullPath(caCert)); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (!File.Exists(dhparam.ToString())) { Console.WriteLine("Could not find dh file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.CTX_load_verify_locations(ctx, caCert, null) @@ -129,23 +138,23 @@ public static void Main(string[] args) { Console.WriteLine("Error loading CA cert"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } int sniArg = haveSNI(args); - if (sniArg >= 0) + if (sniArg >= 0) { string sniHostNameString = args[sniArg].Trim(); sniHostName = Marshal.StringToHGlobalAnsi(sniHostNameString); ushort size = (ushort)sniHostNameString.Length; - if (wolfssl.CTX_UseSNI(ctx, (byte)wolfssl.WOLFSSL_SNI_HOST_NAME, sniHostName, size) != wolfssl.SUCCESS) + if (wolfssl.CTX_UseSNI(ctx, (byte)wolfssl.WOLFSSL_SNI_HOST_NAME, sniHostName, size) != wolfssl.SUCCESS) { Console.WriteLine("UseSNI failed"); wolfssl.CTX_free(ctx); - return; - } + Environment.Exit(1); + } } StringBuilder ciphers = new StringBuilder(new String(' ', 4096)); @@ -159,7 +168,7 @@ public static void Main(string[] args) { Console.WriteLine("ERROR CTX_set_cipher_list()"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } #endif @@ -185,14 +194,14 @@ public static void Main(string[] args) { Console.WriteLine("tcp.Connect() error " + e.ToString()); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (!tcp.Connected) { Console.WriteLine("tcp.Connect() failed!"); tcp.Close(); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } Console.WriteLine("Connected TCP"); @@ -201,7 +210,7 @@ public static void Main(string[] args) { Console.WriteLine("Error in creating ssl object"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } Console.WriteLine("Connection made wolfSSL_connect "); @@ -211,7 +220,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); tcp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } wolfssl.SetTmpDH_file(ssl, dhparam, wolfssl.SSL_FILETYPE_PEM); @@ -222,7 +231,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); tcp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } /* print out results of TLS/SSL accept */ @@ -235,7 +244,7 @@ public static void Main(string[] args) Console.WriteLine("Error in write"); tcp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } /* read and print out the message then reply */ @@ -244,12 +253,14 @@ public static void Main(string[] args) Console.WriteLine("Error in read"); tcp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } Console.WriteLine(buff); wolfssl.shutdown(ssl); tcp.Close(); clean(ssl, ctx); + + Environment.Exit(0); } } diff --git a/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.csproj b/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.csproj index 7afffb9d4e..daac3bb7a6 100644 --- a/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.csproj +++ b/wrapper/CSharp/wolfSSL-TLS-Client/wolfSSL-TLS-Client.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Properties wolfSSL_TLS_Client wolfSSL-TLS-Client - v4.8 + v3.5 512 publish\ true @@ -121,4 +121,4 @@ --> - + \ No newline at end of file diff --git a/wrapper/CSharp/wolfSSL-TLS-PSK-Client/App.config b/wrapper/CSharp/wolfSSL-TLS-PSK-Client/App.config index 8a99d30db7..912a4e01f5 100644 --- a/wrapper/CSharp/wolfSSL-TLS-PSK-Client/App.config +++ b/wrapper/CSharp/wolfSSL-TLS-PSK-Client/App.config @@ -1,6 +1,10 @@ - + + + + + diff --git a/wrapper/CSharp/wolfSSL-TLS-PSK-Client/wolfSSL-TLS-PSK-Client.cs b/wrapper/CSharp/wolfSSL-TLS-PSK-Client/wolfSSL-TLS-PSK-Client.cs index 495e9f1b3f..04a115a269 100644 --- a/wrapper/CSharp/wolfSSL-TLS-PSK-Client/wolfSSL-TLS-PSK-Client.cs +++ b/wrapper/CSharp/wolfSSL-TLS-PSK-Client/wolfSSL-TLS-PSK-Client.cs @@ -85,20 +85,29 @@ public static void Main(string[] args) StringBuilder dhparam = new StringBuilder(wolfssl.setPath("dh2048.pem")); if (dhparam.Length == 0) { Console.WriteLine("Platform not supported"); - return; + Environment.Exit(1); } StringBuilder buff = new StringBuilder(1024); StringBuilder reply = new StringBuilder("Hello, this is the wolfSSL C# client psk wrapper"); - wolfssl.Init(); + Console.WriteLine("Initializing wolfssl..."); + if (wolfssl.Init() == wolfssl.SUCCESS) + { + Console.WriteLine("Successfully initialized wolfssl"); + } + else + { + Console.WriteLine("ERROR: Failed to initialize wolfssl"); + Environment.Exit(1); + } Console.WriteLine("Calling ctx Init from wolfSSL"); ctx = wolfssl.CTX_new(wolfssl.usev23_client()); if (ctx == IntPtr.Zero) { Console.WriteLine("Error creating ctx structure"); - return; + Environment.Exit(1); } Console.WriteLine("Finished init of ctx .... now load in cert and key"); @@ -116,7 +125,7 @@ public static void Main(string[] args) if (wolfssl.CTX_set_cipher_list(ctx, set_cipher) != wolfssl.SUCCESS) { Console.WriteLine("Failed to set cipher suite"); - return; + Environment.Exit(1); } /* Test psk use with DHE */ @@ -133,14 +142,14 @@ public static void Main(string[] args) { Console.WriteLine("tcp.Connect() error " + e.ToString()); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (!tcp.Connected) { Console.WriteLine("tcp.Connect() failed!"); tcp.Close(); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } Console.WriteLine("Connected TCP"); @@ -149,7 +158,7 @@ public static void Main(string[] args) { Console.WriteLine("Error in creating ssl object"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.set_fd(ssl, tcp) != wolfssl.SUCCESS) @@ -158,13 +167,13 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); tcp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } if (!File.Exists(dhparam.ToString())) { Console.WriteLine("Could not find dh file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } wolfssl.SetTmpDH_file(ssl, dhparam, wolfssl.SSL_FILETYPE_PEM); @@ -175,7 +184,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); tcp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } /* print out results of TLS/SSL accept */ @@ -188,7 +197,7 @@ public static void Main(string[] args) Console.WriteLine("Error in write"); tcp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } /* read and print out the message then reply */ @@ -197,12 +206,14 @@ public static void Main(string[] args) Console.WriteLine("Error in read"); tcp.Close(); clean(ssl, ctx); - return; + Environment.Exit(1); } Console.WriteLine(buff); wolfssl.shutdown(ssl); tcp.Close(); clean(ssl, ctx); + + Environment.Exit(0); } } diff --git a/wrapper/CSharp/wolfSSL-TLS-PSK-Client/wolfSSL-TLS-PSK-Client.csproj b/wrapper/CSharp/wolfSSL-TLS-PSK-Client/wolfSSL-TLS-PSK-Client.csproj index 5c3e77e470..d55e3c2ec5 100644 --- a/wrapper/CSharp/wolfSSL-TLS-PSK-Client/wolfSSL-TLS-PSK-Client.csproj +++ b/wrapper/CSharp/wolfSSL-TLS-PSK-Client/wolfSSL-TLS-PSK-Client.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Properties wolfSSL_TLS_PSK_Client wolfSSL-TLS-PSK-Client - v4.8 + v3.5 512 publish\ @@ -112,4 +112,4 @@ --> - + \ No newline at end of file diff --git a/wrapper/CSharp/wolfSSL-TLS-PSK-Server/App.config b/wrapper/CSharp/wolfSSL-TLS-PSK-Server/App.config index 8a99d30db7..41c3509197 100755 --- a/wrapper/CSharp/wolfSSL-TLS-PSK-Server/App.config +++ b/wrapper/CSharp/wolfSSL-TLS-PSK-Server/App.config @@ -1,6 +1,12 @@ - + + + + + + + diff --git a/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.cs b/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.cs index 71c7b7493b..79bf71eac2 100644 --- a/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.cs +++ b/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.cs @@ -86,20 +86,29 @@ public static void Main(string[] args) if (fileCert == "" || fileKey == "" || dhparam.Length == 0) { Console.WriteLine("Platform not supported"); - return; + Environment.Exit(1); } StringBuilder buff = new StringBuilder(1024); StringBuilder reply = new StringBuilder("Hello, this is the wolfSSL C# wrapper"); - wolfssl.Init(); + Console.WriteLine("Initializing wolfssl..."); + if (wolfssl.Init() == wolfssl.SUCCESS) + { + Console.WriteLine("Successfully initialized wolfssl"); + } + else + { + Console.WriteLine("ERROR: Failed to initialize wolfssl"); + Environment.Exit(1); + } Console.WriteLine("Calling ctx Init from wolfSSL"); ctx = wolfssl.CTX_new(wolfssl.useTLSv1_2_server()); if (ctx == IntPtr.Zero) { Console.WriteLine("Error creating ctx structure"); - return; + Environment.Exit(1); } Console.WriteLine("Finished init of ctx .... now load in cert and key"); @@ -107,27 +116,27 @@ public static void Main(string[] args) { Console.WriteLine("Could not find cert or key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (!File.Exists(dhparam.ToString())) { Console.WriteLine("Could not find dh file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.CTX_use_certificate_file(ctx, fileCert, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) { Console.WriteLine("Error in setting cert file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.CTX_use_PrivateKey_file(ctx, fileKey, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) { Console.WriteLine("Error in setting key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } @@ -145,7 +154,7 @@ public static void Main(string[] args) if (wolfssl.CTX_set_cipher_list(ctx, set_cipher) != wolfssl.SUCCESS) { Console.WriteLine("Failed to set cipher suite"); - return; + Environment.Exit(1); } /* Test psk use with DHE */ @@ -154,7 +163,7 @@ public static void Main(string[] args) { Console.WriteLine("Error setting hint"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } wolfssl.CTX_set_psk_server_callback(ctx, psk_cb); @@ -171,7 +180,7 @@ public static void Main(string[] args) Console.WriteLine("Error creating ssl object"); tcp.Stop(); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } Console.WriteLine("Connection made wolfSSL_accept "); @@ -181,7 +190,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } wolfssl.SetTmpDH_file(ssl, dhparam, wolfssl.SSL_FILETYPE_PEM); @@ -192,7 +201,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } /* print out results of TLS/SSL accept */ @@ -205,7 +214,7 @@ public static void Main(string[] args) Console.WriteLine("Error in read"); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } Console.WriteLine(buff); @@ -214,12 +223,14 @@ public static void Main(string[] args) Console.WriteLine("Error in write"); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } wolfssl.shutdown(ssl); fd.Close(); tcp.Stop(); clean(ssl, ctx); + + Environment.Exit(0); } } diff --git a/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.csproj b/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.csproj index 1f31752ec7..c7db9ab016 100755 --- a/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.csproj +++ b/wrapper/CSharp/wolfSSL-TLS-PSK-Server/wolfSSL-TLS-PSK-Server.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Properties wolfSSL_TLS_PSK_Server wolfSSL-TLS-PSK-Server - v4.8 + v3.5 512 @@ -85,4 +85,4 @@ --> - + \ No newline at end of file diff --git a/wrapper/CSharp/wolfSSL-TLS-Server/App.config b/wrapper/CSharp/wolfSSL-TLS-Server/App.config index 8a99d30db7..912a4e01f5 100755 --- a/wrapper/CSharp/wolfSSL-TLS-Server/App.config +++ b/wrapper/CSharp/wolfSSL-TLS-Server/App.config @@ -1,6 +1,10 @@ - + + + + + diff --git a/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs b/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs index 79d4234f23..28f14cc6f7 100644 --- a/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs +++ b/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs @@ -94,7 +94,7 @@ public static void Main(string[] args) if (fileCert == "" || fileKey == "" || dhparam.Length == 0) { Console.WriteLine("Platform not supported."); - return; + Environment.Exit(1); } StringBuilder buff = new StringBuilder(1024); @@ -103,14 +103,23 @@ public static void Main(string[] args) //example of function used for setting logging wolfssl.SetLogging(standard_log); - wolfssl.Init(); + Console.WriteLine("Initializing wolfssl..."); + if (wolfssl.Init() == wolfssl.SUCCESS) + { + Console.WriteLine("Successfully initialized wolfssl"); + } + else + { + Console.WriteLine("ERROR: Failed to initialize wolfssl"); + Environment.Exit(1); + } Console.WriteLine("Calling ctx Init from wolfSSL"); ctx = wolfssl.CTX_new(wolfssl.usev23_server()); if (ctx == IntPtr.Zero) { Console.WriteLine("Error in creating ctx structure"); - return; + Environment.Exit(1); } Console.WriteLine("Finished init of ctx .... now load in cert and key"); @@ -118,27 +127,27 @@ public static void Main(string[] args) { Console.WriteLine("Could not find cert or key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (!File.Exists(dhparam.ToString())) { Console.WriteLine("Could not find dh file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.CTX_use_certificate_file(ctx, fileCert, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) { Console.WriteLine("Error in setting cert file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.CTX_use_PrivateKey_file(ctx, fileKey, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) { Console.WriteLine("Error in setting key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } StringBuilder ciphers = new StringBuilder(new String(' ', 4096)); @@ -161,10 +170,10 @@ public static void Main(string[] args) { Console.WriteLine("Error in creating ssl object"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } - if (haveSNI(args)) + if (haveSNI(args)) { // Allocating memory and setting SNI arg int test_value = 32; @@ -173,7 +182,7 @@ public static void Main(string[] args) if (wolfssl.CTX_set_servername_arg(ctx, arg_sni) == wolfssl.FAILURE) { Console.WriteLine("wolfssl.CTX_set_servername_arg failed"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } // Setting SNI delegate @@ -188,7 +197,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } if (wolfssl.SetTmpDH_file(ssl, dhparam, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) @@ -197,7 +206,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } if (wolfssl.accept(ssl) != wolfssl.SUCCESS) @@ -206,7 +215,7 @@ public static void Main(string[] args) Console.WriteLine(wolfssl.get_error(ssl)); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } /* get and print sni used by the client */ @@ -229,7 +238,7 @@ public static void Main(string[] args) Console.WriteLine("Error in read"); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } Console.WriteLine(buff); @@ -258,13 +267,13 @@ public static void Main(string[] args) 0x0a, 0x05, 0x01, 0x04, 0x01, 0x02, 0x01, 0x04, 0x03, 0x02, 0x03 }; - int ret = wolfssl.SNI_GetFromBuffer(buffer, 1024, 0, result, inOutSz); - + int ret = wolfssl.SNI_GetFromBuffer(buffer, 1024, 0, result, inOutSz); + if (ret != wolfssl.SUCCESS) { Console.WriteLine("Error on reading SNI from buffer, ret value = " + ret); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } string resultStr = Marshal.PtrToStringAnsi(result); @@ -277,7 +286,7 @@ public static void Main(string[] args) Console.WriteLine("Error in write"); tcp.Stop(); clean(ssl, ctx); - return; + Environment.Exit(1); } wolfssl.shutdown(ssl); @@ -285,5 +294,7 @@ public static void Main(string[] args) tcp.Stop(); clean(ssl, ctx); + + Environment.Exit(0); } } diff --git a/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.csproj b/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.csproj index 1cc073e83c..39412050c4 100755 --- a/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.csproj +++ b/wrapper/CSharp/wolfSSL-TLS-Server/wolfSSL-TLS-Server.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Properties wolfSSL_TLS_Server wolfSSL-TLS-Server - v4.8 + v3.5 512 publish\ true @@ -73,9 +73,6 @@ - - - @@ -121,4 +118,4 @@ --> - + \ No newline at end of file diff --git a/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/App.config b/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/App.config index 8a99d30db7..912a4e01f5 100644 --- a/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/App.config +++ b/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/App.config @@ -1,6 +1,10 @@ - + + + + + diff --git a/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/wolfSSL-TLS-ServerThreaded.cs b/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/wolfSSL-TLS-ServerThreaded.cs index c2de6336fa..6262e89d2d 100644 --- a/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/wolfSSL-TLS-ServerThreaded.cs +++ b/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/wolfSSL-TLS-ServerThreaded.cs @@ -122,19 +122,29 @@ public static void Main(string[] args) if (fileCert == "" || fileKey == "" || dhparam.Length == 0) { Console.WriteLine("Platform not supported"); - return; + Environment.Exit(1); } /* example of function used for setting logging */ - wolfssl.SetLogging(standard_log); - wolfssl.Init(); + wolfssl.SetLogging(standard_log); + + Console.WriteLine("Initializing wolfssl..."); + if (wolfssl.Init() == wolfssl.SUCCESS) + { + Console.WriteLine("Successfully initialized wolfssl"); + } + else + { + Console.WriteLine("ERROR: Failed to initialize wolfssl"); + Environment.Exit(1); + } Console.WriteLine("Calling ctx Init from wolfSSL"); ctx = wolfssl.CTX_new(wolfssl.usev23_server()); if (ctx == IntPtr.Zero) { Console.WriteLine("Error in creating ctx structure"); - return; + Environment.Exit(1); } Console.WriteLine("Finished init of ctx .... now load in cert and key"); @@ -142,27 +152,27 @@ public static void Main(string[] args) { Console.WriteLine("Could not find cert or key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (!File.Exists(dhparam.ToString())) { Console.WriteLine("Could not find dh file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.CTX_use_certificate_file(ctx, fileCert, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) { Console.WriteLine("Error in setting cert file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } if (wolfssl.CTX_use_PrivateKey_file(ctx, fileKey, wolfssl.SSL_FILETYPE_PEM) != wolfssl.SUCCESS) { Console.WriteLine("Error in setting key file"); wolfssl.CTX_free(ctx); - return; + Environment.Exit(1); } StringBuilder ciphers = new StringBuilder(new String(' ', 4096)); @@ -201,5 +211,7 @@ public static void Main(string[] args) tcp.Stop(); wolfssl.CTX_free(ctx); wolfssl.Cleanup(); + + Environment.Exit(0); } } diff --git a/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/wolfSSL-TLS-ServerThreaded.csproj b/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/wolfSSL-TLS-ServerThreaded.csproj index f1468d14f2..f5e2a3487e 100644 --- a/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/wolfSSL-TLS-ServerThreaded.csproj +++ b/wrapper/CSharp/wolfSSL-TLS-ServerThreaded/wolfSSL-TLS-ServerThreaded.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Properties wolfSSL_TLS_ServerThreaded wolfSSL-TLS-ServerThreaded - v4.8 + v3.5 512 publish\ true @@ -121,4 +121,4 @@ --> - + \ No newline at end of file diff --git a/wrapper/CSharp/wolfSSL_CSharp.sln b/wrapper/CSharp/wolfSSL_CSharp.sln index 48e170a48d..c13164b1f6 100644 --- a/wrapper/CSharp/wolfSSL_CSharp.sln +++ b/wrapper/CSharp/wolfSSL_CSharp.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.6.33815.320 @@ -31,6 +30,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wolfSSL-TLS-PSK-Client", "w EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wolfCrypt-Test", "wolfCrypt-Test\wolfCrypt-Test.csproj", "{A4F4A244-1306-47F4-A168-31F78D7362FA}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wolfssl Files", "wolfssl Files", "{FF2B4F87-2F25-4123-BCF6-8A20089B965A}" + ProjectSection(SolutionItems) = preProject + README.md = README.md + user_settings.h = user_settings.h + ..\..\.github\workflows\visual-studio.yml = ..\..\.github\workflows\visual-studio.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -173,8 +179,8 @@ Global {67932048-D67E-4C86-B55F-90899B9BDA64}.Debug|Win32.Build.0 = Debug|Win32 {67932048-D67E-4C86-B55F-90899B9BDA64}.Debug|x64.ActiveCfg = DLL Debug|x64 {67932048-D67E-4C86-B55F-90899B9BDA64}.Debug|x64.Build.0 = DLL Debug|x64 - {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|Any CPU.ActiveCfg = DLL Debug|Win32 - {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|Any CPU.Build.0 = DLL Debug|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|Any CPU.ActiveCfg = DLL Debug|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|Any CPU.Build.0 = DLL Debug|x64 {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 diff --git a/wrapper/CSharp/wolfSSL_CSharp/Properties/AssemblyInfo.cs b/wrapper/CSharp/wolfSSL_CSharp/Properties/AssemblyInfo.cs index 0c110c0b9a..cf157578ed 100644 --- a/wrapper/CSharp/wolfSSL_CSharp/Properties/AssemblyInfo.cs +++ b/wrapper/CSharp/wolfSSL_CSharp/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("wolfSSL")] [assembly: AssemblyProduct("wolfSSL.CSharp")] -[assembly: AssemblyCopyright("Copyright wolfSSL 2020")] +[assembly: AssemblyCopyright("Copyright (C) 2006-2025 wolfSSL Inc.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/wrapper/CSharp/wolfSSL_CSharp/wolfCrypt.cs b/wrapper/CSharp/wolfSSL_CSharp/wolfCrypt.cs index c5249d1f31..dd559eab46 100644 --- a/wrapper/CSharp/wolfSSL_CSharp/wolfCrypt.cs +++ b/wrapper/CSharp/wolfSSL_CSharp/wolfCrypt.cs @@ -1645,7 +1645,7 @@ public static int Ed25519SignMsg(byte[] inMsg, out byte[] outMsg, IntPtr key) if (inMsgPtr != IntPtr.Zero) Marshal.FreeHGlobal(inMsgPtr); if (outMsgPtr != IntPtr.Zero) Marshal.FreeHGlobal(outMsgPtr); } - + return ret; } @@ -2429,11 +2429,11 @@ public static byte[] Curve25519ExportPublicKey(IntPtr key) /// Export both private and public keys from a Curve25519 key structure /// /// Curve25519 key structure - /// A tuple containing the private key and public key as byte arrays - public static (byte[] privateKey, byte[] publicKey) Curve25519ExportKeyRaw(IntPtr key) + /// void, see `out` parameters containing the private key and public key as byte arrays + public static void Curve25519ExportKeyRaw(IntPtr key, out byte[] privateKey, out byte[] publicKey) { - byte[] privateKey = new byte[ED25519_KEY_SIZE]; - byte[] publicKey = new byte[ED25519_PUB_KEY_SIZE]; + privateKey = new byte[ED25519_KEY_SIZE]; + publicKey = new byte[ED25519_PUB_KEY_SIZE]; uint privSize = (uint)privateKey.Length; uint pubSize = (uint)publicKey.Length; int ret = wc_curve25519_export_key_raw(key, privateKey, ref privSize, publicKey, ref pubSize); @@ -2441,7 +2441,8 @@ public static (byte[] privateKey, byte[] publicKey) Curve25519ExportKeyRaw(IntPt { throw new Exception("Failed to export Curve25519 keys. Error code: " + ret); } - return (privateKey, publicKey); + + return; } /* END RAW Curve25519 */ diff --git a/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs b/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs index a493e722ca..6e656353b7 100644 --- a/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs +++ b/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs @@ -21,17 +21,46 @@ using System; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading; +using System.Configuration; using System.IO; using System.Net; using System.Net.Sockets; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; +/* using System.Threading; not supported in older frameworks */ + +#if USE_STDCALL + /* See wolfssl visibiliity.h */ +#error "__stdcall is not allowed. Use CallingConvention.Cdecl instead." +#endif -namespace wolfSSL.CSharp { +namespace wolfSSL.CSharp +{ public class wolfssl { - private const string wolfssl_dll = "wolfssl.dll"; + /* Import necessary Windows API functions to manually load library */ + [DllImport("kernel32.dll", SetLastError = true)] + private static extern IntPtr LoadLibrary(string dllPath); + + [DllImport("kernel32.dll", SetLastError = true)] + private static extern IntPtr GetProcAddress(IntPtr hModule, string procName); + + [DllImport("kernel32.dll", SetLastError = true)] + private static extern bool FreeLibrary(IntPtr hModule); + + private static IntPtr _dllHandle; + + private const string wolfssl_dll = "wolfssl.dll"; + private const string WOLFSSL_CERTS_PATH_KEY = "WOLFSSL_CERTS_PATH"; + private const string WOLFSSL_DLL_PATH_KEY = "WOLFSSL_DLL_PATH"; + + /* See also optional hints to find wolfSSL binary: + * WOLFSSL_ROOT environment setting + * WOLFSSL_DLL_PATH App.config setting + */ + + private static bool _DEBUG_WOLFSSL = false; /* wait for 6 seconds default on TCP socket state poll if timeout not set */ private const int WC_WAIT = 6000000; @@ -232,6 +261,240 @@ public void free() } } + private static string WriteDebugString(string s, string hintText) + { + string ret = string.Empty; +#if DEBUG + if (string.IsNullOrEmpty(hintText)) + { + ret = s; + Console.WriteLine(ret); + } + else + { + if (s.Contains("%s")) + { + ret = s.Replace("%s", hintText); + } + else + { + ret = hintText + s; + } + + Console.WriteLine(ret); + } +#endif + return ret; + } + + static string GetBuildConfiguration() + { +#if DEBUG + return "Debug"; +#else + return "Release"; +#endif + } + + static string GetArchitecture() + { + string ret = "Unknown"; + + Assembly assembly = Assembly.GetExecutingAssembly(); + ProcessorArchitecture arch = assembly.GetName().ProcessorArchitecture; + + switch (arch) + { + case ProcessorArchitecture.MSIL: + ret = "AnyCPU"; + break; + case ProcessorArchitecture.X86: + ret = "x86"; + break; + case ProcessorArchitecture.Amd64: + ret = "x64"; + break; +#if ARM + case ProcessorArchitecture.Arm: + ret = "Arm"; + break + case ProcessorArchitecture.Arm64: + ret = "Arm64"; + break; +#endif + default: return "Unknown"; + } + + return ret; + } + + /* Helper to check for wolfssl.dll in a specific location */ + private static string CheckWolfSSLPath(string thisPath, string hintText) + { + string processorArch; + string configAttr; + string thisName; + string thisFullPath; + string thisStartingPath; + string altPath; + string originalPath; + string ret = ""; + + bool foundLib = false; + bool isSearchDone = false; + bool searchAlternates = false; + + originalPath = thisPath; + processorArch = GetArchitecture(); + configAttr = GetBuildConfiguration(); + + WriteDebugString("Enter CheckWolfSSLPath()", ""); + WriteDebugString(" - thisPath:'%s`", thisPath); + WriteDebugString(" - hintText:'%s`", hintText); + + if (string.IsNullOrEmpty(thisPath)) + { + WriteDebugString(" - %s is not defined, not used to search for wolfssl.", hintText); + } + else + { + thisStartingPath = thisPath; + altPath = thisPath; + + while (!foundLib && !isSearchDone) + { + thisFullPath = Path.GetFullPath(thisStartingPath) + Path.DirectorySeparatorChar + wolfssl_dll; + + if (string.IsNullOrEmpty(thisFullPath)) + { + WriteDebugString(" - path empty:", hintText); + } + else + { + if (File.Exists(thisFullPath)) + { + WriteDebugString(" - Found wolfssl.dll from " + hintText + ":\r\n" + thisFullPath, hintText); + foundLib = true; + ret = thisFullPath; + } + else + { + if (searchAlternates) + { + WriteDebugString(" - %s: '" + altPath + "'", "Tried alternate"); + } + else + { + WriteDebugString(" - WARNING: wolfssl.dll not found from %s = " + thisPath, hintText); + + } + } + } + + if (!foundLib) + { + thisName = Path.GetFileName(thisStartingPath).ToString(); + if (thisName == processorArch) + { + /* get the [dir] parent 2 levels up from [dir]\\Debug\\AnyCPU */ + altPath = Directory.GetParent(thisStartingPath).FullName; + altPath = Directory.GetParent(altPath).FullName; + searchAlternates = true; + } + thisName = Path.GetFileName(thisStartingPath).ToString(); + if (thisName == configAttr) + { + /* get the [dir] parent from [dir]\\Debug */ + altPath = Directory.GetParent(thisStartingPath).FullName; + searchAlternates = true; + } + + /* We'll search alternates only if the path started in [configAttr][processorArch] (e.g. Debug\AnyCPU) + * as we will never want to search in something like C:\windows\system32\Debug\AnyCPU */ + if (searchAlternates) + { + /* see if the next iteration would be the root directory */ + if (Directory.GetParent(Directory.GetParent(altPath).FullName) is null) + { + /* We'll never find the dll someplace like C:\Debug\AnyCPU\wolfssl.dll */ + isSearchDone = true; + } + else + { + altPath = Directory.GetParent(altPath).FullName; /* get the parent */ + + thisStartingPath = altPath + Path.DirectorySeparatorChar + + configAttr.ToString() + Path.DirectorySeparatorChar + + processorArch.ToString(); + + Console.WriteLine(" - New alt = " + thisStartingPath); + } + } + else + { + isSearchDone = true; + } + } + } /* while not found */ + } /* thisPath is not empty */ + + return ret; + } + + /* Helper to find wolfSSL in the usual locations */ + private static string GetWolfSSLPath(string default_path) + { + string wolfsslPath; + string dllPath; + + if (default_path == wolfssl_dll) + { + /* this will typically be [WOLFSSL_ROOT]\\wrapper\\CSharp\\Debug\\x64" */ + wolfsslPath = Environment.CurrentDirectory; /* no path specified */ + } + else + { + /* some other path specified */ + wolfsslPath = default_path; + } + + wolfsslPath = CheckWolfSSLPath(wolfsslPath, "Default location" ); + + if (string.IsNullOrEmpty(wolfsslPath)) + { + wolfsslPath =CheckWolfSSLPath( + ConfigurationManager.AppSettings[WOLFSSL_DLL_PATH_KEY], + "App.config " + WOLFSSL_DLL_PATH_KEY + " setting"); + } + + if (string.IsNullOrEmpty(wolfsslPath)) + { + wolfsslPath = CheckWolfSSLPath( + Environment.GetEnvironmentVariable("WOLFSSL_ROOT"), + "Environment Variable WOLFSSL_ROOT setting"); + } + + /* Did we find wolfSSL specified anywhere? */ + if (string.IsNullOrEmpty(wolfsslPath)) + { + /* Just use the name, search using path */ + wolfsslPath = ""; + dllPath = Path.Combine(wolfsslPath, "wolfssl.dll"); + } + else + { + dllPath = wolfsslPath; + } + + + if (!File.Exists(dllPath)) + { + WriteDebugString("Will try to find wolfSSL in system path.", ""); + dllPath = "wolfssl.dll"; + } + + return dllPath; + } /* GetWolfSSLPath */ /******************************** * Init wolfSSL library @@ -495,18 +758,76 @@ private static IntPtr unwrap_ssl(IntPtr ssl) /// return the platform specific path to the certificate /// public static string setPath(string file) { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - Console.WriteLine("Linux - " + file); - return @"../../certs/" + file; - } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + string pathPrefix = ""; + bool foundCertFile = false; + PlatformID platform = Environment.OSVersion.Platform; + + pathPrefix = ConfigurationManager.AppSettings[WOLFSSL_CERTS_PATH_KEY]; + if (string.IsNullOrEmpty(pathPrefix)) { - Console.WriteLine("Windows - " + file); - return @"../../../../certs/" + file; - } else + WriteDebugString("No App.config setting found for %s", WOLFSSL_CERTS_PATH_KEY); + } + else { - return ""; + pathPrefix = ConfigurationManager.AppSettings[WOLFSSL_CERTS_PATH_KEY]; + if (string.IsNullOrEmpty(pathPrefix)) + { + WriteDebugString("SetPath App.config " + WOLFSSL_CERTS_PATH_KEY + " is not configured.", ""); + } + else + { + WriteDebugString("Found App.config WOLFSSL_CERTS_PATH_KEY: '%s'", pathPrefix); + pathPrefix += Path.DirectorySeparatorChar; + foundCertFile = (File.Exists(pathPrefix + file)); + if (foundCertFile) + { + WriteDebugString("Found cert file: '%s'", pathPrefix + file); + } + else + { + WriteDebugString("Not found: '%s'", pathPrefix + file); + } + } } + + if (!foundCertFile) + { + if (platform == PlatformID.Unix || platform == PlatformID.MacOSX) + { + pathPrefix = @"../../certs/"; + Console.Write("Linux cert path: "); + } + else if (platform == PlatformID.Win32NT || + platform == PlatformID.Win32Windows || + platform == PlatformID.Win32S || + platform == PlatformID.WinCE) + { + pathPrefix = @"../../../../certs/"; + Console.Write("Windows cert path: "); + } + else + { + Console.WriteLine("WARNING: Platform not detected. Looking for certs in local directory."); + pathPrefix = ""; + } + foundCertFile = (File.Exists(pathPrefix + Path.DirectorySeparatorChar + file)); + + /* Not found with App config, nor usual example directory structure, try one parent up. */ + if (!foundCertFile) + { + /* Client example solution is one directory deeper */ + pathPrefix = "../" + pathPrefix; + if (!Directory.Exists(pathPrefix)) + { + Console.WriteLine("Path not found: " + pathPrefix); + } + } + } /* !foundCertFile with App.config */ + + + + Console.WriteLine(Path.GetFullPath(pathPrefix + file)); + return Path.GetFullPath(pathPrefix + file); } @@ -790,8 +1111,7 @@ public static int read(IntPtr ssl, StringBuilder buf, int sz) int ret; byte[] msg; - buf.Clear(); /* Clear incoming buffer */ - + buf.Length = 0;/* Clear incoming buffer; buf.Clear(); not available in old frameworks */ if (sslCtx == IntPtr.Zero) { log(ERROR_LOG, "read ssl unwrap error"); @@ -1149,7 +1469,7 @@ public static void CTX_free(IntPtr ctx) } } - public static void CTX_set_servername_callback(IntPtr ctx, sni_delegate sni_cb) + public static void CTX_set_servername_callback(IntPtr ctx, sni_delegate sni_cb) { try { GCHandle gch = GCHandle.FromIntPtr(ctx); @@ -1163,7 +1483,7 @@ public static void CTX_set_servername_callback(IntPtr ctx, sni_delegate sni_cb) } } - public static int CTX_set_servername_arg(IntPtr ctx, IntPtr arg) + public static int CTX_set_servername_arg(IntPtr ctx, IntPtr arg) { try { GCHandle gch = GCHandle.FromIntPtr(ctx); @@ -1178,7 +1498,7 @@ public static int CTX_set_servername_arg(IntPtr ctx, IntPtr arg) } } - public static int CTX_UseSNI(IntPtr ctx, byte type, IntPtr data, ushort size) + public static int CTX_UseSNI(IntPtr ctx, byte type, IntPtr data, ushort size) { try { GCHandle gch = GCHandle.FromIntPtr(ctx); @@ -1191,7 +1511,7 @@ public static int CTX_UseSNI(IntPtr ctx, byte type, IntPtr data, ushort size) } } - public static int UseSNI(IntPtr ssl, byte type, IntPtr data, ushort size) + public static int UseSNI(IntPtr ssl, byte type, IntPtr data, ushort size) { try { GCHandle gch = GCHandle.FromIntPtr(ssl); @@ -1204,7 +1524,7 @@ public static int UseSNI(IntPtr ssl, byte type, IntPtr data, ushort size) } } - public static ushort SNI_GetRequest(IntPtr ssl, byte type, ref IntPtr data) + public static ushort SNI_GetRequest(IntPtr ssl, byte type, ref IntPtr data) { try { GCHandle gch = GCHandle.FromIntPtr(ssl); @@ -1217,7 +1537,7 @@ public static ushort SNI_GetRequest(IntPtr ssl, byte type, ref IntPtr data) } } - public static int SNI_GetFromBuffer(byte []clientHello, uint helloSz, byte type, IntPtr sni, IntPtr inOutSz) + public static int SNI_GetFromBuffer(byte []clientHello, uint helloSz, byte type, IntPtr sni, IntPtr inOutSz) { try { return wolfSSL_SNI_GetFromBuffer(clientHello, helloSz, type, sni, inOutSz); @@ -1500,7 +1820,6 @@ public static int get_ciphers(StringBuilder list, int sz) } } - /// /// Initialize wolfSSL library /// @@ -1509,6 +1828,44 @@ public static int Init() { try { + string this_wolfssl_path; + this_wolfssl_path = GetWolfSSLPath(wolfssl_dll); + + _dllHandle = LoadLibrary(this_wolfssl_path); + if (_dllHandle == IntPtr.Zero) + { + Console.WriteLine("Warning: Could not load " + this_wolfssl_path); + if (File.Exists(this_wolfssl_path)) + { + Console.WriteLine("File found, check contents or security settings"); + } + else + { + Console.WriteLine("File not found: " + this_wolfssl_path); + } + /* We could throw an exception here, but GetProcAddress should throw one, below */ + } + else + { + if (_DEBUG_WOLFSSL) + { + Console.WriteLine("Successfully loaded wolfssl: " + this_wolfssl_path); + } + else + { + /* Alternatively check the Project Build Configuration for DEBUG */ + WriteDebugString("Successfully loaded wolfssl: %s", this_wolfssl_path); + } + } + + IntPtr initPtr = GetProcAddress(_dllHandle, "wolfSSL_Init"); + if (initPtr == IntPtr.Zero) + { + Console.WriteLine("Error: Could not find function wolfSSL_Init."); + Console.WriteLine("Check for build preprocessor option: WOLFSSL_DLL"); + Console.WriteLine("Try building with the 'DLL Debug' configuration."); + FreeLibrary(_dllHandle); + } return wolfSSL_Init(); } catch (Exception e) @@ -2177,6 +2534,7 @@ public static int X509_STORE_CTX_get_error(IntPtr x509Ctx) /// public static void Debugging_ON() { + _DEBUG_WOLFSSL = true; wolfSSL_Debugging_ON(); } @@ -2185,9 +2543,14 @@ public static void Debugging_ON() /// public static void Debugging_OFF() { + _DEBUG_WOLFSSL = false; wolfSSL_Debugging_OFF(); } + public static bool DEBUG_WOLFSSL() + { + return _DEBUG_WOLFSSL; + } /// /// Set the function to use for logging /// diff --git a/wrapper/CSharp/wolfSSL_CSharp/wolfSSL_CSharp.csproj b/wrapper/CSharp/wolfSSL_CSharp/wolfSSL_CSharp.csproj index a560347cc9..67e39dcecc 100755 --- a/wrapper/CSharp/wolfSSL_CSharp/wolfSSL_CSharp.csproj +++ b/wrapper/CSharp/wolfSSL_CSharp/wolfSSL_CSharp.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Properties wolfSSL.CSharp wolfSSL_CSharp - v4.8 + v3.5 512 @@ -21,6 +21,7 @@ DEBUG;TRACE prompt 3 + false pdbonly @@ -29,6 +30,7 @@ TRACE prompt 4 + false true @@ -39,6 +41,7 @@ x64 prompt MinimumRecommendedRules.ruleset + false $(SolutionDir)$(Configuration)\$(Platform)\ @@ -48,12 +51,11 @@ x64 prompt MinimumRecommendedRules.ruleset + false - - - + diff --git a/wrapper/CSharp/wolfssl.vcxproj b/wrapper/CSharp/wolfssl.vcxproj index 1d142db4b1..84d0730269 100644 --- a/wrapper/CSharp/wolfssl.vcxproj +++ b/wrapper/CSharp/wolfssl.vcxproj @@ -1,456 +1,460 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - Release - Win32 - - - Release - x64 - - - - {67932048-d67e-4c86-b55f-90899b9bda64} - wolfssl - Win32Proj - - - - StaticLibrary - v143 - Unicode - true - - - DynamicLibrary - v143 - Unicode - true - - - StaticLibrary - v143 - Unicode - true - - - DynamicLibrary - v143 - Unicode - true - - - StaticLibrary - v143 - Unicode - - - DynamicLibrary - v143 - Unicode - - - StaticLibrary - v143 - Unicode - - - DynamicLibrary - v143 - Unicode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(SolutionDir)$(Configuration)\$(Platform)\ - $(Configuration)\$(Platform)\$(ProjectName)_obj\ - - - $(SolutionDir)$(Configuration)\AnyCPU\ - $(Configuration)\AnyCPU\$(ProjectName)_obj\ - - - $(SolutionDir)$(Configuration)\$(Platform)\ - $(Configuration)\$(Platform)\$(ProjectName)_obj\ - - - $(SolutionDir)$(Configuration)\AnyCPU\ - $(Configuration)\AnyCPU\$(ProjectName)_obj\ - - - $(SolutionDir)Release\$(Platform)\ - Release\$(Platform)\$(ProjectName)_obj\ - - - $(SolutionDir)Release\AnyCPU\ - Release\AnyCPU\$(ProjectName)_obj\ - - - $(SolutionDir)Debug\$(Platform)\ - Debug\$(Platform)\$(ProjectName)_obj\ - - - $(SolutionDir)Debug\AnyCPU\ - Debug\AnyCPU\$(ProjectName)_obj\ - - - - Disabled - ./;../../;%(AdditionalIncludeDirectories) - WOLFSSL_LIB;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - Level4 - EditAndContinue - 4206;4214;4706;%(DisableSpecificWarnings) - - - - - Disabled - ./;../../;%(AdditionalIncludeDirectories) - BUILDING_WOLFSSL;WOLFSSL_DLL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - EditAndContinue - 4206;4214;4706;%(DisableSpecificWarnings) - - - ws2_32.lib;%(AdditionalDependencies) - false - true - false - - - - - Disabled - ./;../../;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - ProgramDatabase - 4206;4214;4706;%(DisableSpecificWarnings) - - - - - Disabled - ./;../../;%(AdditionalIncludeDirectories) - BUILDING_WOLFSSL;WOLFSSL_DLL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level4 - ProgramDatabase - 4206;4214;4706;%(DisableSpecificWarnings) - - - ws2_32.lib;%(AdditionalDependencies) - false - true - - - - - MaxSpeed - true - ./;../../;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - Level3 - ProgramDatabase - - - - - MaxSpeed - true - ./;../../;%(AdditionalIncludeDirectories) - BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - ws2_32.lib;%(AdditionalDependencies) - true - - - - - MaxSpeed - true - ./;../../;%(AdditionalIncludeDirectories) - WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - - - MaxSpeed - true - ./;../../;%(AdditionalIncludeDirectories) - BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - ws2_32.lib;%(AdditionalDependencies) - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - - - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - - - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - - - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - - - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - - - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - false - false - ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) - ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) - $(OutDir)%(Filename).obj - $(IntDir)%(Filename).obj - - - - - - true - true - true - true - - - - - - + + + + + Debug + Win32 + + + Debug + x64 + + + DLL Debug + Win32 + + + DLL Debug + x64 + + + DLL Release + Win32 + + + DLL Release + x64 + + + Release + Win32 + + + Release + x64 + + + + {67932048-d67e-4c86-b55f-90899b9bda64} + wolfssl + Win32Proj + 10.0 + + + + StaticLibrary + v143 + Unicode + true + + + DynamicLibrary + v143 + Unicode + true + + + StaticLibrary + v143 + Unicode + true + + + DynamicLibrary + v143 + Unicode + true + + + StaticLibrary + v143 + Unicode + + + DynamicLibrary + v143 + Unicode + + + StaticLibrary + v143 + Unicode + + + DynamicLibrary + Unicode + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)$(Configuration)\$(Platform)\ + $(Configuration)\$(Platform)\$(ProjectName)_obj\ + + + $(SolutionDir)$(Configuration)\AnyCPU\ + $(Configuration)\AnyCPU\$(ProjectName)_obj\ + + + $(SolutionDir)$(Configuration)\$(Platform)\ + $(Configuration)\$(Platform)\$(ProjectName)_obj\ + + + $(SolutionDir)$(Configuration)\AnyCPU\ + $(Configuration)\AnyCPU\$(ProjectName)_obj\ + + + $(SolutionDir)Release\$(Platform)\ + Release\$(Platform)\$(ProjectName)_obj\ + + + $(SolutionDir)Release\AnyCPU\ + Release\AnyCPU\$(ProjectName)_obj\ + + + $(SolutionDir)Debug\$(Platform)\ + Debug\$(Platform)\$(ProjectName)_obj\ + + + $(SolutionDir)Debug\AnyCPU\ + Debug\AnyCPU\$(ProjectName)_obj\ + + + + Disabled + ./;../../;%(AdditionalIncludeDirectories) + WOLFSSL_LIB;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + Level4 + EditAndContinue + 4206;4214;4706;%(DisableSpecificWarnings) + + + + + Disabled + ./;../../;%(AdditionalIncludeDirectories) + BUILDING_WOLFSSL;WOLFSSL_DLL;WOLFSSL_USER_SETTINGS;DLL_DEBUG;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + EditAndContinue + 4206;4214;4706;%(DisableSpecificWarnings) + + + ws2_32.lib;%(AdditionalDependencies) + false + true + false + + + + + Disabled + ./;../../;%(AdditionalIncludeDirectories) + WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + ProgramDatabase + 4206;4214;4706;%(DisableSpecificWarnings) + + + + + Disabled + ./;../../;%(AdditionalIncludeDirectories) + BUILDING_WOLFSSL;WOLFSSL_DLL;WOLFSSL_USER_SETTINGS;DLL_DEBUG;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + ProgramDatabase + 4206;4214;4706;%(DisableSpecificWarnings) + + + ws2_32.lib;%(AdditionalDependencies) + false + true + + + + + MaxSpeed + true + ./;../../;%(AdditionalIncludeDirectories) + WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + Level3 + ProgramDatabase + + + + + MaxSpeed + true + ./;../../;%(AdditionalIncludeDirectories) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + ws2_32.lib;%(AdditionalDependencies) + true + + + + + MaxSpeed + true + ./;../../;%(AdditionalIncludeDirectories) + WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + + + MaxSpeed + true + ./;../../;%(AdditionalIncludeDirectories) + BUILDING_WOLFSSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + ws2_32.lib;%(AdditionalDependencies) + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + + + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + + + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + + + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + + + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + + + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + false + false + ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity) + ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity) + $(OutDir)%(Filename).obj + $(IntDir)%(Filename).obj + + + + + + true + true + true + true + + + + + + + + + diff --git a/wrapper/CSharp/wolfssl_clients/wolfSSL_CSharp-Clients.sln b/wrapper/CSharp/wolfssl_clients/wolfSSL_CSharp-Clients.sln new file mode 100644 index 0000000000..cbe24ba9ea --- /dev/null +++ b/wrapper/CSharp/wolfssl_clients/wolfSSL_CSharp-Clients.sln @@ -0,0 +1,312 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33815.320 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wolfSSL_CSharp", "..\wolfSSL_CSharp\wolfSSL_CSharp.csproj", "{52609808-0418-46D3-8E17-141927A1A39A}" + ProjectSection(ProjectDependencies) = postProject + {67932048-D67E-4C86-B55F-90899B9BDA64} = {67932048-D67E-4C86-B55F-90899B9BDA64} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wolfssl", "..\wolfssl.vcxproj", "{67932048-D67E-4C86-B55F-90899B9BDA64}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wolfSSL-TLS-Client", "..\wolfSSL-TLS-Client\wolfSSL-TLS-Client.csproj", "{B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wolfSSL-TLS-PSK-Client", "..\wolfSSL-TLS-PSK-Client\wolfSSL-TLS-PSK-Client.csproj", "{4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wolfCrypt-Test", "..\wolfCrypt-Test\wolfCrypt-Test.csproj", "{A4F4A244-1306-47F4-A168-31F78D7362FA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wolfssl Files", "wolfssl Files", "{FF2B4F87-2F25-4123-BCF6-8A20089B965A}" + ProjectSection(SolutionItems) = preProject + README.md = ..\README.md + user_settings.h = //\user_settings.h + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + DLL Debug|Any CPU = DLL Debug|Any CPU + DLL Debug|Win32 = DLL Debug|Win32 + DLL Debug|x64 = DLL Debug|x64 + DLL Release|Any CPU = DLL Release|Any CPU + DLL Release|Win32 = DLL Release|Win32 + DLL Release|x64 = DLL Release|x64 + Release|Any CPU = Release|Any CPU + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {52609808-0418-46D3-8E17-141927A1A39A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.Debug|Win32.ActiveCfg = Debug|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.Debug|Win32.Build.0 = Debug|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.Debug|x64.ActiveCfg = Debug|x64 + {52609808-0418-46D3-8E17-141927A1A39A}.Debug|x64.Build.0 = Debug|x64 + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Debug|Any CPU.ActiveCfg = Debug|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Debug|Any CPU.Build.0 = Debug|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Debug|Win32.ActiveCfg = Debug|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Debug|Win32.Build.0 = Debug|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Debug|x64.ActiveCfg = Debug|x64 + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Debug|x64.Build.0 = Debug|x64 + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Release|Any CPU.ActiveCfg = Release|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Release|Any CPU.Build.0 = Release|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Release|Win32.ActiveCfg = Release|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Release|Win32.Build.0 = Release|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Release|x64.ActiveCfg = Release|x64 + {52609808-0418-46D3-8E17-141927A1A39A}.DLL Release|x64.Build.0 = Release|x64 + {52609808-0418-46D3-8E17-141927A1A39A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.Release|Any CPU.Build.0 = Release|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.Release|Win32.ActiveCfg = Release|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.Release|Win32.Build.0 = Release|Any CPU + {52609808-0418-46D3-8E17-141927A1A39A}.Release|x64.ActiveCfg = Release|x64 + {52609808-0418-46D3-8E17-141927A1A39A}.Release|x64.Build.0 = Release|x64 + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Debug|Win32.ActiveCfg = Debug|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Debug|Win32.Build.0 = Debug|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Debug|x64.ActiveCfg = Debug|x64 + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Debug|x64.Build.0 = Debug|x64 + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Debug|Any CPU.Build.0 = Debug|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Debug|Win32.ActiveCfg = Debug|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Debug|Win32.Build.0 = Debug|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Debug|x64.ActiveCfg = Debug|x64 + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Debug|x64.Build.0 = Debug|x64 + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Release|Any CPU.ActiveCfg = Release|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Release|Any CPU.Build.0 = Release|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Release|Win32.ActiveCfg = Release|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Release|Win32.Build.0 = Release|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Release|x64.ActiveCfg = Release|x64 + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.DLL Release|x64.Build.0 = Release|x64 + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Release|Any CPU.Build.0 = Release|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Release|Win32.ActiveCfg = Release|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Release|Win32.Build.0 = Release|Any CPU + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Release|x64.ActiveCfg = Release|x64 + {8921AD35-4E62-4DAC-8FEE-8C9F8E57DDD2}.Release|x64.Build.0 = Release|x64 + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Debug|Win32.ActiveCfg = Debug|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Debug|Win32.Build.0 = Debug|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Debug|x64.ActiveCfg = Debug|x64 + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Debug|x64.Build.0 = Debug|x64 + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Debug|Any CPU.ActiveCfg = Debug|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Debug|Any CPU.Build.0 = Debug|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Debug|Win32.ActiveCfg = Debug|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Debug|Win32.Build.0 = Debug|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Debug|x64.ActiveCfg = Debug|x64 + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Debug|x64.Build.0 = Debug|x64 + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Release|Any CPU.ActiveCfg = Release|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Release|Any CPU.Build.0 = Release|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Release|Win32.ActiveCfg = Release|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Release|Win32.Build.0 = Release|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Release|x64.ActiveCfg = Release|x64 + {030431C7-26AB-4447-815B-F27E88BE5D5B}.DLL Release|x64.Build.0 = Release|x64 + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Release|Any CPU.Build.0 = Release|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Release|Win32.ActiveCfg = Release|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Release|Win32.Build.0 = Release|Any CPU + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Release|x64.ActiveCfg = Release|x64 + {030431C7-26AB-4447-815B-F27E88BE5D5B}.Release|x64.Build.0 = Release|x64 + {730F047E-37A6-498F-A543-B6C98AA7B338}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.Debug|Any CPU.Build.0 = Debug|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.Debug|Win32.ActiveCfg = Debug|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.Debug|Win32.Build.0 = Debug|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.Debug|x64.ActiveCfg = Debug|x64 + {730F047E-37A6-498F-A543-B6C98AA7B338}.Debug|x64.Build.0 = Debug|x64 + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Debug|Any CPU.ActiveCfg = Debug|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Debug|Any CPU.Build.0 = Debug|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Debug|Win32.ActiveCfg = Debug|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Debug|Win32.Build.0 = Debug|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Debug|x64.ActiveCfg = Debug|x64 + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Debug|x64.Build.0 = Debug|x64 + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Release|Any CPU.ActiveCfg = Release|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Release|Any CPU.Build.0 = Release|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Release|Win32.ActiveCfg = Release|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Release|Win32.Build.0 = Release|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Release|x64.ActiveCfg = Release|x64 + {730F047E-37A6-498F-A543-B6C98AA7B338}.DLL Release|x64.Build.0 = Release|x64 + {730F047E-37A6-498F-A543-B6C98AA7B338}.Release|Any CPU.ActiveCfg = Release|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.Release|Any CPU.Build.0 = Release|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.Release|Win32.ActiveCfg = Release|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.Release|Win32.Build.0 = Release|Any CPU + {730F047E-37A6-498F-A543-B6C98AA7B338}.Release|x64.ActiveCfg = Release|x64 + {730F047E-37A6-498F-A543-B6C98AA7B338}.Release|x64.Build.0 = Release|x64 + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Debug|Win32.ActiveCfg = Debug|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Debug|Win32.Build.0 = Debug|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Debug|x64.ActiveCfg = Debug|x64 + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Debug|x64.Build.0 = Debug|x64 + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Debug|Any CPU.Build.0 = Debug|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Debug|Win32.ActiveCfg = Debug|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Debug|Win32.Build.0 = Debug|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Debug|x64.ActiveCfg = Debug|x64 + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Debug|x64.Build.0 = Debug|x64 + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Release|Any CPU.ActiveCfg = Release|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Release|Any CPU.Build.0 = Release|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Release|Win32.ActiveCfg = Release|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Release|Win32.Build.0 = Release|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Release|x64.ActiveCfg = Release|x64 + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.DLL Release|x64.Build.0 = Release|x64 + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Release|Any CPU.Build.0 = Release|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Release|Win32.ActiveCfg = Release|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Release|Win32.Build.0 = Release|Any CPU + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Release|x64.ActiveCfg = Release|x64 + {77AEF1BE-4BE3-4837-8188-2A06E4D963F5}.Release|x64.Build.0 = Release|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Debug|Any CPU.ActiveCfg = DLL Debug|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Debug|Any CPU.Build.0 = DLL Debug|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Debug|Win32.ActiveCfg = Debug|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Debug|Win32.Build.0 = Debug|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Debug|x64.ActiveCfg = DLL Debug|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Debug|x64.Build.0 = DLL Debug|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|Any CPU.ActiveCfg = DLL Debug|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|Any CPU.Build.0 = DLL Debug|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Release|Any CPU.ActiveCfg = DLL Release|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Release|Any CPU.Build.0 = DLL Release|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.DLL Release|x64.Build.0 = DLL Release|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Release|Any CPU.ActiveCfg = DLL Release|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Release|Any CPU.Build.0 = DLL Release|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Release|Win32.ActiveCfg = Release|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Release|Win32.Build.0 = Release|Win32 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Release|x64.ActiveCfg = DLL Release|x64 + {67932048-D67E-4C86-B55F-90899B9BDA64}.Release|x64.Build.0 = DLL Release|x64 + {E2415718-0A15-48DB-A774-01FB0093B626}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.Debug|Win32.Build.0 = Debug|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.Debug|x64.ActiveCfg = Debug|x64 + {E2415718-0A15-48DB-A774-01FB0093B626}.Debug|x64.Build.0 = Debug|x64 + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Debug|Any CPU.Build.0 = Debug|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Debug|Win32.ActiveCfg = Debug|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Debug|Win32.Build.0 = Debug|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Debug|x64.ActiveCfg = Debug|x64 + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Debug|x64.Build.0 = Debug|x64 + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Release|Any CPU.ActiveCfg = Release|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Release|Any CPU.Build.0 = Release|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Release|Win32.ActiveCfg = Release|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Release|Win32.Build.0 = Release|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Release|x64.ActiveCfg = Release|x64 + {E2415718-0A15-48DB-A774-01FB0093B626}.DLL Release|x64.Build.0 = Release|x64 + {E2415718-0A15-48DB-A774-01FB0093B626}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.Release|Any CPU.Build.0 = Release|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.Release|Win32.ActiveCfg = Release|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.Release|Win32.Build.0 = Release|Any CPU + {E2415718-0A15-48DB-A774-01FB0093B626}.Release|x64.ActiveCfg = Release|x64 + {E2415718-0A15-48DB-A774-01FB0093B626}.Release|x64.Build.0 = Release|x64 + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Debug|Win32.Build.0 = Debug|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Debug|x64.ActiveCfg = Debug|x64 + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Debug|x64.Build.0 = Debug|x64 + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Debug|Any CPU.Build.0 = Debug|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Debug|Win32.ActiveCfg = Debug|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Debug|Win32.Build.0 = Debug|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Debug|x64.ActiveCfg = Debug|x64 + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Debug|x64.Build.0 = Debug|x64 + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Release|Any CPU.ActiveCfg = Release|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Release|Any CPU.Build.0 = Release|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Release|Win32.ActiveCfg = Release|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Release|Win32.Build.0 = Release|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Release|x64.ActiveCfg = Release|x64 + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.DLL Release|x64.Build.0 = Release|x64 + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Release|Any CPU.Build.0 = Release|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Release|Win32.ActiveCfg = Release|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Release|Win32.Build.0 = Release|Any CPU + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Release|x64.ActiveCfg = Release|x64 + {B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}.Release|x64.Build.0 = Release|x64 + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Debug|Win32.ActiveCfg = Debug|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Debug|Win32.Build.0 = Debug|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Debug|x64.ActiveCfg = Debug|x64 + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Debug|x64.Build.0 = Debug|x64 + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Debug|Any CPU.Build.0 = Debug|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Debug|Win32.ActiveCfg = Debug|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Debug|Win32.Build.0 = Debug|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Debug|x64.ActiveCfg = Debug|x64 + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Debug|x64.Build.0 = Debug|x64 + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Release|Any CPU.ActiveCfg = Release|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Release|Any CPU.Build.0 = Release|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Release|Win32.ActiveCfg = Release|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Release|Win32.Build.0 = Release|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Release|x64.ActiveCfg = Release|x64 + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.DLL Release|x64.Build.0 = Release|x64 + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Release|Any CPU.Build.0 = Release|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Release|Win32.ActiveCfg = Release|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Release|Win32.Build.0 = Release|Any CPU + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Release|x64.ActiveCfg = Release|x64 + {8ABD2E8F-AEE7-40ED-A966-900ACFAE555F}.Release|x64.Build.0 = Release|x64 + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Debug|Win32.Build.0 = Debug|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Debug|x64.ActiveCfg = Debug|x64 + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Debug|x64.Build.0 = Debug|x64 + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Debug|Any CPU.Build.0 = Debug|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Debug|Win32.ActiveCfg = Debug|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Debug|Win32.Build.0 = Debug|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Debug|x64.ActiveCfg = Debug|x64 + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Debug|x64.Build.0 = Debug|x64 + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Release|Any CPU.ActiveCfg = Release|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Release|Any CPU.Build.0 = Release|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Release|Win32.ActiveCfg = Release|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Release|Win32.Build.0 = Release|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Release|x64.ActiveCfg = Release|x64 + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.DLL Release|x64.Build.0 = Release|x64 + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Release|Any CPU.Build.0 = Release|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Release|Win32.ActiveCfg = Release|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Release|Win32.Build.0 = Release|Any CPU + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Release|x64.ActiveCfg = Release|x64 + {4F92ECF5-A1D8-4A13-AD0C-6571EB03C01C}.Release|x64.Build.0 = Release|x64 + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Debug|Win32.Build.0 = Debug|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Debug|x64.ActiveCfg = Debug|x64 + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Debug|x64.Build.0 = Debug|x64 + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Debug|Any CPU.Build.0 = Debug|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Debug|Win32.ActiveCfg = Debug|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Debug|Win32.Build.0 = Debug|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Debug|x64.ActiveCfg = Debug|x64 + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Debug|x64.Build.0 = Debug|x64 + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Release|Any CPU.ActiveCfg = Release|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Release|Any CPU.Build.0 = Release|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Release|Win32.ActiveCfg = Release|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Release|Win32.Build.0 = Release|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Release|x64.ActiveCfg = Release|x64 + {A4F4A244-1306-47F4-A168-31F78D7362FA}.DLL Release|x64.Build.0 = Release|x64 + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Release|Any CPU.Build.0 = Release|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Release|Win32.ActiveCfg = Release|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Release|Win32.Build.0 = Release|Any CPU + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Release|x64.ActiveCfg = Release|x64 + {A4F4A244-1306-47F4-A168-31F78D7362FA}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {63D316F8-C4EE-449A-B9A6-FC673C4D5D31} + EndGlobalSection +EndGlobal