Skip to content

Commit

Permalink
Merge pull request #316 from dgarske/win_vs
Browse files Browse the repository at this point in the history
Added Windows Visual Studio project for wolfTPM
  • Loading branch information
embhorn authored Dec 8, 2023
2 parents 20081b6 + 71878e5 commit c1930a4
Show file tree
Hide file tree
Showing 17 changed files with 1,997 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/make-test-swtpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
WOLFSSL_PATH=./wolfssl ./examples/run_examples.sh
- name: make install
run: sudo make install
- name: make dist
run: make dist

# build and test CSharp wrapper
- name: Install mono
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/win-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Windows Build Test

on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]

jobs:
build:

runs-on: windows-latest

# This should be a safe limit for the tests to run.
timeout-minutes: 6

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: wolftpm\IDE\VisualStudio\wolftpm.sln

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Debug
BUILD_PLATFORM: x64

steps:
- name: Pull wolfTPM
uses: actions/checkout@master
with:
repository: wolfssl/wolftpm
path: wolftpm

- name: Pull wolfssl
uses: actions/checkout@master
with:
repository: wolfssl/wolfssl
path: wolfssl
- name: Create FIPS stub files (autogen)
working-directory: wolfssl
run: |
echo $null >> wolfcrypt\src\fips.c
echo $null >> wolfcrypt\src\fips_test.c
echo $null >> wolfcrypt\src\wolfcrypt_first.c
echo $null >> wolfcrypt\src\wolfcrypt_last.c
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

# The GitHub CI runners do not have a TPM.
# Failure 0x8028400f: unknown error number
# TBS_E_TPM_NOT_FOUND (0x8028400F) A compatible Trusted Platform Module (TPM) Security Device cannot be found on this computer.
#- name: Run Wrap Test
# working-directory: ${{env.GITHUB_WORKSPACE}}
# run: wolftpm\IDE\VisualStudio\Debug\x64\wrap_test.exe
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ docs/html
# Wrapper
wrapper/CSharp/obj
wrapper/CSharp/bin

# Visual Studio
IDE/VisualStudio/Debug
IDE/VisualStudio/DLL Debug
IDE/VisualStudio/DLL Release
IDE/VisualStudio/Release
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ endif("${WOLFTPM_INTERFACE}" STREQUAL "auto")

if(WIN32)
target_compile_definitions(wolftpm PRIVATE
"_WINDLL"
"WOLFTPM_DLL"
)
endif(WIN32)

Expand Down
8 changes: 4 additions & 4 deletions IDE/STM32CUBE/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# included from Top Level Makefile.am
# All paths should be given relative to the root

EXTRA_DIST+= ide/STM32CUBE/wolftpm_test.c
EXTRA_DIST+= ide/STM32CUBE/wolftpm_test.h
EXTRA_DIST+= ide/STM32CUBE/README.md
EXTRA_DIST+= ide/STM32CUBE/default_conf.ftl
EXTRA_DIST+= IDE/STM32CUBE/wolftpm_test.c
EXTRA_DIST+= IDE/STM32CUBE/wolftpm_test.h
EXTRA_DIST+= IDE/STM32CUBE/README.md
EXTRA_DIST+= IDE/STM32CUBE/default_conf.ftl
7 changes: 7 additions & 0 deletions IDE/VisualStudio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Visual Studio Solution for wolfTPM

This includes projects for building wolfssl, wolftpm and some examples. The solution and project are based on older VS 2015, but can be retargeted / updated to newer when opened.

All build settings are contained in IDE/VisualStudio/user_settings.h. This module supports using the FIPS ready bundle from the website. Just enable the `#if 0` FIPS section in user_settings.h. See wolfssl/IDE/WIN10/README.txt for details on setting the FIPS integrity check in fips_test.c at run-time.

These projects assume `wolftpm` and `wolfssl` directories reside next to each other.
12 changes: 12 additions & 0 deletions IDE/VisualStudio/include.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root

EXTRA_DIST+= IDE/VisualStudio/README.md
EXTRA_DIST+= IDE/VisualStudio/wolftpm.sln
EXTRA_DIST+= IDE/VisualStudio/wolftpm.vcxproj
EXTRA_DIST+= IDE/VisualStudio/wolfssl.vcxproj
EXTRA_DIST+= IDE/VisualStudio/wolfcrypt_test.vcxproj
EXTRA_DIST+= IDE/VisualStudio/tls_server.vcxproj
EXTRA_DIST+= IDE/VisualStudio/wrap_test.vcxproj
EXTRA_DIST+= IDE/VisualStudio/user_settings.h
Loading

0 comments on commit c1930a4

Please sign in to comment.