Skip to content

Commit

Permalink
wolfTPM v1.0 TPM 2.0 support:
Browse files Browse the repository at this point in the history
* Support for all TPM2 API's using TIS and SPI IO callback.
* Helper for getting TPM return code string `TPM2_GetRCString`.
* TPM 2.0 demo code in `examples/tpm/tpm2_demo.c` with support for STM32 CubeMX SPI as reference.

Requires wolfSSL (wolfSSL/wolfssl#1344)
  • Loading branch information
dgarske committed Feb 7, 2018
1 parent d222d71 commit 8bf8ae3
Show file tree
Hide file tree
Showing 52 changed files with 12,722 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .gitignore
@@ -0,0 +1,23 @@
.metadata
language.settings.xml
src/config.h.in
autom4te.cache
build-aux
aclocal.m4
configure
Makefile.in
m4
aminclude.am
config.log
config.status
libtool
Makefile
wolftpm-config
.dirstamp
*.la
*.lo
config.h
stamp-h1
test-suite.log
src/.deps
src/.libs
176 changes: 176 additions & 0 deletions IDE/OPENSTM32/.cproject

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions IDE/OPENSTM32/.project
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>wolfSTM32_CubeMX</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>fr.ac6.mcu.ide.core.MCUProjectNature</nature>
</natures>
</projectDescription>
47 changes: 47 additions & 0 deletions IDE/OPENSTM32/Inc/wolftpm_example.h
@@ -0,0 +1,47 @@
/* wolftpm_example.h
*
* Copyright (C) 2006-2017 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* wolfTPM is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfTPM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/


#ifndef WOLFTPM_EXAMPLE_H_
#define WOLFTPM_EXAMPLE_H_

#include <stm32f4xx_hal.h>
#include <stm32f4xx.h>
#include <cmsis_os.h>

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfcrypt/test/test.h>
#include <wolfcrypt/benchmark/benchmark.h>

#include <wolftpm/tpm2.h>

void wolfTPMDemo(void const * argument);


#endif /* WOLFTPM_EXAMPLE_H_ */
27 changes: 27 additions & 0 deletions IDE/OPENSTM32/README.md
@@ -0,0 +1,27 @@
# wolfSSL STM32F2/F4 Example for Open STM32 Tools System Workbench


## Requirements

* STM32CubeMX: STM32 CubeMX HAL code generation tool - [http://www.st.com/en/development-tools/stm32cubemx.html](http://www.st.com/en/development-tools/stm32cubemx.html)
* SystemWorkbench for STM32 - [http://www.st.com/en/development-tools/sw4stm32.html](http://www.st.com/en/development-tools/sw4stm32.html)

## Setup

1. Using the STM32CubeMX tool, load the `<wolfssl-root>/IDE/OPENSTM32/wolfSTM32.ino` file.
2. Adjust the HAL options based on your specific micro-controller.
3. Generate source code.
4. Run `SystemWorkbench` and choose a new workspace location for this project.
5. Import `wolfSTM32' project from `<wolfssl-root>/IDE/OPENSTM32/`.
6. Adjust the micro-controller define in `Project Settings -> C/C++ General -> Paths and Symbols -> Symbols -> GNU C`. Example uses `STM32F437xx`, but should be changed to reflect your micro-controller type.
7. Build and Run

Note: You may need to manually copy over the CubeMX HAL files for `stm32f4xx_hal_cryp.c`, `stm32f4xx_hal_cryp_ex.c`, `stm32f4xx_hal_cryp.h`, `stm32f4xx_hal_cryp_ex.h`. Also uncomment the `#define HAL_CRYP_MODULE_ENABLED` line in `stm32f4xx_hal_conf.h`.

## Configuration

The settings for the wolfSTM32 project are located in `<wolfssl-root>/IDE/OPENSTM32/Inc/user_settings.h`.

## Support

For questions please email [support@wolfssl.com](mailto:support@wolfssl.com)

0 comments on commit 8bf8ae3

Please sign in to comment.