The TPM Software Stack from Microsoft Research
Перейти к файлу
microsoft-github-policy-service[bot] 60c26b51cf
Auto merge mandatory file pr
This pr is auto merged as it contains a mandatory file and is opened for more than 10 days.
2023-06-13 17:53:40 +00:00
NuGet TSS.Net nuget and build configuaration updated 2020-11-09 19:01:15 -08:00
PCPTool.v11
TSS.C@c4e389517c
TSS.CPP
TSS.JS Merge branch 'master' into update-to-12 2021-08-27 13:46:34 -07:00
TSS.Java Bump bcprov-jdk15on from 1.60 to 1.67 in /TSS.Java 2021-08-13 15:27:39 +00:00
TSS.NET Allow decryption of empty-length OAEP messages. 2022-05-20 10:21:04 -07:00
TSS.Py
Tpm2Tester Fix the Tpm2Tester build 2022-07-07 13:55:20 -07:00
TssCodeGen Mark non-flattened TPM2B's as parameter encryptable 2022-05-06 14:49:03 -07:00
.gitignore
.gitmodules
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2021-04-12 11:24:22 -07:00
LICENSE
README.md
SECURITY.md Microsoft mandatory file 2023-06-02 21:25:59 +00:00
Using the TSS.C++ Library.docx
Using the TSS.Net Library.docx

README.md

TSS.MSR

TPM 2.0 ecosystem

Trusted Platform Module (TPM) is a security component forming roots of trust in many PCs, servers and mobile devices. TPMs provide security functionality in the areas of:

  • Cryptographic key generation, protection, management, and use
  • Cryptographic device identity
  • Secure logging and log-reporting, i.e., attestation
  • Secure non-volatile storage
  • Other functions including hashing, random number generation, a secure clock, etc.

Microsoft Windows operating system relies on the TPM for a number of its security functions. Examples include BitLocker™ drive encryption, the Windows Virtual Smart Card feature, and the Platform Crypto Provider. Windows 10 requires TPM 2.0 to be enabled in all its desktop editions (Home, Pro, Enterprise, and Education) and in server editions running guarded fabric.

Both Windows and Linux operating systems expose low-level programmatic access to their TPM 2.0 devices. On Windows TPM 2.0 is available via TPM Base Services (TBS) API, and on Linux - via /dev/tpm0 or /dev/tpmrm0 device file abstractions. For the purposes of TPM 2.0 application development it is extremely convenient to use the TPM 2.0 simulator developed, open-sourced, and maintained on behalf of TCG by Microsoft.

TPM Software Stack (TSS) implementations from Microsoft

All flavors of TPM 2.0 devices mentioned in the previous section communicate with applications via a rather complex binary interface defined by the TCG's TPM 2.0 specification wrapped into OS/simulator specific protocols. Writing code for manual creation of the TPM 2.0 command buffers, parsing response buffers, building HMAC and policy sessions, verifying audit data, etc., is extremely tedious, time consuming, and error prone task.

In order to facilitate the development of applications and services using TPM 2.0, Microsoft has developed a series of TSS implementations for different programming languages. All these implementations provide complete representation of the TPM 2.0 API (commands, data structures, enumerations, unions) using the means of the corresponding languages, and some of them - additional functionality that greatly simplifies communications with TPM 2.0. All TSS.MSR implementations provide abstraction for Windows/Linux/Simulator TPM 2.0 devices.

TSS.Net and TSS.CPP

TSS.Net and TSS.CPP are written in C# and C++ correspondingly, and are the richest TSS implementations in this collection. Besides complete abstraction of the TPM 2.0 interface, they implement additional functionality, such as:

  • automatic handling of HMAC and policy sessions;
  • expected audit, policy and cpHashes computation;
  • object oriented representation of the policy commands;
  • multiple helpers simplifying bridging between software crypto and TPM 2.0.

TSS.Java, TSS.JS, and TSS.Py

These implementations are for Java, Node.JS, and Python environments, and at the moment they provide complete abstraction of the TPM 2.0 interface without most of the additional capabilities of TSS.Net or TSS.CPP. Node.JS version is written in the TypeScript language.

TSS Code Generator

TssCodeGen is the tool that parses TPM 2.0 specification documents and updates the TSS implementations in this repo so that all TPM 2.0 entity and command definitions match the contents of the specification. The tool can be easily extended to support other programming languages, as all language specific processing is highly localized and most of the logic is language independent.

Tpm2Tester

This is the TSS.Net based framework used by the official TPM 2.0 compliance test suite and TPM 2.0 components of the Microsoft Windows HLK. See its README document for the details of the framework API and usage.

Along with it comes a sample test suite that not only demonstrates the framework usage, but also contains additional samples of the TPM 2.0 use cases, and is convenient for quick prototyping and testing of TPM 2.0 based scenarios.

System Requirements

TSS.Net is a cross-platform .NET Standard library and requires Visual Studio 2017 or above to build it. It can target one of the following .NET framework flavors: .NET 4.7.2, .NET Core 2.1 (for both Windows and Linux), .NET Standard 2.0, and .NET UWP 10.0. You can download the latest versions of the .NET Framework here.

TSS.Java uses Java SE 8 or above, TSS.JS requires Node.js 4.8.4 or higher, and TSS.Py supports Python 2.7 and 3.5+.

Platform Crypto Provider Toolkit

The TSS.MSR project also provides the TPM Platform Crypto Provider Toolkit. It contains sample code, utilities, and documentation for using TPM-related functionality on Windows 8.x/10 systems. It covers TPM-backed Crypto-Next-Gen (CNG) Platform Crypto Provider, and illustrates how attestation service providers can use the new Windows 8.x features. Both TPM 1.2 and TPM 2.0-based systems are supported.

See Also

Questions and Feedback

We hope that the TSS.MSR project will prove useful to both software developers and researchers in their development of security solutions and applications for the Windows operating system.

Feel free to use Issues section of this Github repo for any quetsions or problems.

For private feedback please use tssdotnet@microsoft.com (for all managed languages) or tssdotcpp@microsoft.com mailing lists.