From 6bb14c20b68bd65f677fd04d803e001291fb816b Mon Sep 17 00:00:00 2001 From: Elms Date: Tue, 13 Oct 2020 11:42:44 -0700 Subject: [PATCH] winapi: Add readme --- Makefile.am | 1 + README.md | 5 ++++ docs/WindowTBS.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 docs/WindowTBS.md diff --git a/Makefile.am b/Makefile.am index 22d08b3..5d6be19 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,6 +41,7 @@ include tests/include.am EXTRA_DIST+= README.md EXTRA_DIST+= docs/SWTPM.md +EXTRA_DIST+= docs/WindowTBS.md EXTRA_DIST+= ChangeLog.md EXTRA_DIST+= LICENSE EXTRA_DIST+= autogen.sh diff --git a/README.md b/README.md index 1d38160..23d346e 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ autogen.sh requires: automake and libtool: `sudo apt-get install automake libtoo --enable-devtpm Enable using Linux kernel driver for /dev/tpmX (default: disabled) - WOLFTPM_LINUX_DEV --enable-swtpm Enable using SWTPM TCP protocol. For use with simulator. (default: disabled) - WOLFTPM_SWTPM +--enable-winapi Use Windows TBS API. (default: disabled) - WOLFTPM_WINAPI WOLFTPM_USE_SYMMETRIC Enables symmetric AES/Hashing/HMAC support for TLS examples. WOLFTPM2_USE_SW_ECDHE Disables use of TPM for ECC ephemeral key generation and shared secret for TLS examples. @@ -216,6 +217,10 @@ sudo adduser yourusername tss See `docs/SWTPM.md` +### Building for Windows TBS API + +See `docs/WindowTBS.md` + ## Running Examples These examples demonstrate features of a TPM 2.0 module. The examples create RSA and ECC keys in NV for testing using handles defined in `./examples/tpm_io.h`. The PKCS #7 and TLS examples require generating CSR's and signing them using a test script. See `examples/README.md` for details on using the examples. To run the TLS sever and client on same machine you must build with `WOLFTPM_TIS_LOCK` to enable concurrent access protection. diff --git a/docs/WindowTBS.md b/docs/WindowTBS.md new file mode 100644 index 0000000..123999d --- /dev/null +++ b/docs/WindowTBS.md @@ -0,0 +1,61 @@ +# Using wolfTPM with Windows TBS + +wolfTPM can be built to use Windows native TBS (TPM Base Services) + +## Building in MSYS2 + +Tested using MSYS2 + +``` +export PREFIX=$PWD/tmp_install + +cd wolfssl +./autogen.sh +./configure --prefix=$PREFIX +make +make install + +cd wolftpm/ +./autogen.sh +./configure --prefix=$PREFIX --enable-winapi +make +./examples +``` + +## Building on linux + +Tested using mingw-w32-bin_x86_64-linux_20131221.tar.bz2 +[source](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Automated%20Builds/) + +Extract the tools and add them to the `PATH` +``` +mkdir mingw_tools +cd mingw_tools +tar xjvf ../mingw-w32-bin_x86_64-linux_20131221.tar.bz2 +export PATH=$PWD/bin/:$PWD/i686-w64-mingw32/bin:$PATH +cd .. +``` + +Build +``` +export PREFIX=$PWD/tmp_install + +cd wolfssl +./autogen.sh +./configure --host=i686 CC=i686-w64-mingw32-gcc CFLAGS="-DWIN32 -DMINGW -D_WIN32_WINNT=0x0600" LIBS="-lws2_32" --prefix=$PREFIX +make +make install + +cd ../wolftpm/ +./autogen.sh +./configure --host=i686 CC=i686-w64-mingw32-gcc CFLAGS="-DWIN32 -DMINGW -D_WIN32_WINNT=0x0600" LIBS="-lws2_32" --prefix=$PREFIX --enable-winapi +make +``` + +## Running on Windows + +To confirm presence and status of TPM on the machine run `tpm.msc` + +See [examples/README.md](examples/README.md) + +