How trustedcomputinggroup/tpm works
This is the official TPM 2.0 reference implementation, with a TCP simulator for exercising the TPM as a device. The principal workflow is a client sending a protocol-encapsulated command to the simulator, which bridges it to TPM command processing and returns a response. The TPM implementation also covers authorization sessions, cryptography, NV state, and platform signals. The map preserves these major runtime areas; unsampled internal wiring is shown only where documented or marked unverified.
Main entry points: SessionProcess.c Command processing · TcpServer.c TCP server · command TPM commands · Session.c Session lifecycle
Components 16
Simulator interface
- TCP server
TPMCmd/Simulator/src/TcpServer.c - TCP protocol
TPMCmd/Simulator/include/TpmTcpProtocol.h - Simulator bridge
TPMCmd/Simulator/src/TPMCmdp.c
TPM command runtime
- Command processing
TPMCmd/tpm/src/main/SessionProcess.c - TPM commands
TPMCmd/tpm/src/command - Marshalling
TPMCmd/tpm/src/support/Marshal.c - NV commands
TPMCmd/tpm/src/command/NVStorage
Security services
- Session lifecycle
TPMCmd/tpm/src/subsystem/Session.c - Session commands
TPMCmd/tpm/src/command/Session/StartAuthSession.c - Policy authorization
TPMCmd/tpm/src/command/EA/PolicyAuthorize.c - Cryptographic operations
TPMCmd/tpm/src/crypt/CryptUtil.c - Crypto interfaces
TPMCmd/tpm/cryptolibs/common/include/CryptoInterface.h
Platform state
- NV persistence
TPMCmd/Platform/src/NVMem.c - Platform services
TPMCmd/Platform/src - TPM configuration
TPMCmd/TpmConfiguration/TpmConfiguration
Other components
- TSS client
Connections 15
- TSS client → TCP server: sends commands
- TCP server → TCP protocol: handles messages
- TCP server → Simulator bridge: dispatches requests
- Simulator bridge → Command processing: submits command
- Command processing → Marshalling: marshals responses
- Command processing → TPM commands: dispatches commands
- Command processing → Session lifecycle: processes sessions
TPMCmd/tpm/src/main/SessionProcess.c - Session commands → Session lifecycle: creates sessions
TPMCmd/tpm/src/command/Session/StartAuthSession.c - Policy authorization → Session lifecycle: gets session
TPMCmd/tpm/src/command/EA/PolicyAuthorize.c - TPM commands → Cryptographic operations: uses cryptography
- Cryptographic operations → Crypto interfaces: uses interface
- NV commands → NV persistence: accesses NV
- Command processing → Platform services: uses platform hooks
- TPM configuration → TPM commands: configures command set
- TCP server → TSS client: returns responses