Skip to content

armenon-rh/rust_manufacture_tcg_tpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TPM Manufacture TCG

This utility is a Rust wrapper around the Trusted Computing Group (TCG) TPM 2.0 reference implementation. It performs the "manufacturing" process for a software TPM, initializing its persistent state.

Description

The tool links against the official TCG TPM C reference code (included as a submodule). It:

  1. Initializes the TPM's Non-Volatile (NV) memory system.
  2. Executes TPM_Manufacture to set up the initial TPM state (seeds, hierarchies, etc.).
  3. Persists the resulting state to a file named NVChip in the current directory.

Prerequisites

Before building, ensure you have the following installed:

  1. Rust & Cargo: Install Rust

  2. C Compiler: gcc or clang (required to compile the C reference code).

  3. OpenSSL Development Headers: The project links against libcrypto.

    • Ubuntu/Debian:
      sudo apt-get install libssl-dev
    • Fedora/RHEL:
      sudo dnf install openssl-devel
    • macOS:
      brew install openssl
      # You may need to set OPENSSL_DIR if brew doesn't link it automatically

Building

Clone the repository and its submodules, then build with Cargo:

# Clone with submodules
git clone --recursive <repository-url>
cd tpm_manufacture_tcg

# Build
cargo build --release

Note: If you already cloned without --recursive, run git submodule update --init --recursive to fetch the C source code.

Usage

Run the utility directly with Cargo:

cargo run --release

Output

If successful, you will see:

Starting TCG TPM Manufacture utility...
TPM Manufacture successful. State saved to 'NVChip'.

A file named NVChip will be created in your current working directory. This file represents the persistent storage of your simulated TPM.

Troubleshooting

Error: openssl/aes.h: No such file or directory
This means the OpenSSL development headers are missing. Install libssl-dev (or equivalent) as described in Prerequisites.

About

Rust utility to manufacture TCG implementation of TPM using its C backend

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages