prosig / tpm2simulator

TPM 2.0 Simulator Extraction Script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TPM 2.0 Simulator Extraction Script

The purpose of this script is to extract the source code from the publicly available PDF version 01.16 of the Trusted Platform Module Library Specification published by the Trusted Computing Group (TCG).

The result of the extraction scripts is a complete set of the source files for a Trusted Platform Module (TPM) 2.0 Simulator, which runs under Windows, Linux, as well as Genode (by applying the appropriate patches).

Note: The extraction script also works with a Microsoft Word-based FODT-version of the more recent specifications (e.g., version 01.19), which are however only available to TCG members.

License: The files of this project are licensed under BSD 2-Clause License (except where indicated otherwise).


User Instructions

Extraction

Requirements

Make sure the following packages are installed on your system:

cmake
build-essential
python-bs4
python-pip
python-dev

Also install the python module "pyastyle" for formatted output:

pip install pyastyle

Extracting the source code

  1. Open a Terminal and navigate to the project folder tpm2simulator
  2. Edit configuration settings in the file tpm2simulator/scripts/settings.py and change SET = False to SET = True when finished
  3. Create a folder named build and run the following command inside:
cmake -G "Unix Makefiles" ../cmake -DCMAKE_BUILD_TYPE=Debug -DSPEC_VERSION=116

This command

  • runs the Python script to extract the simulator source code
  • patches files containing the source code
  • generates a Makefile used for building the simulator

Building and running the simulator

  1. Build the simulator
make
  1. Run the simulator:
./Simulator

(If there are any error messages at startup, restart simulator)

Testing

In order to test if the simulator is working correctly, we use IBM's TPM 2.0 TSS

  1. Open a Terminal and start the TPM simulator

  2. Open another Terminal and navigate to the project folder ibmtpm20tss/utils

  3. Build the TSS:

make
  1. Run the tests:
./reg.sh -a

Credits

This project was created by Steffen Wagner (Fraunhofer AISEC).

Special thanks to Sergej Proskurin and Tamás Bakos for their support in implementing the script.

IBM's TPM 2.0 TSS was created by Ken Goldman and is licensed under the Berkeley Software Distribution (BSD) License. We'd like to thank Ken for implementing and providing a TSS that also includes test cases, which we could use to verify the extracted source code of the TPM 2.0 simulator.

pyastyle (created by Timon Wong, NHNCN) and Artistic Style (licensed under GNU Lesser General Public License version 3.0)

About

TPM 2.0 Simulator Extraction Script

License:BSD 2-Clause "Simplified" License


Languages

Language:C 76.8%Language:Python 14.5%Language:C++ 7.0%Language:Objective-C 1.3%Language:CMake 0.3%