How havenoverflow/tpm2 works
This is a C implementation of TPM 2.0 functionality, derived from the TCG library sample code; the tree also includes simulator and platform-support code. A principal command workflow is request decoding, command execution, and response encoding, but the available excerpts do not show the dispatcher wiring, so that flow is not asserted. The graph preserves major command domains and internal layers visible in the tree and source index. Edges are limited to relationships stated in excerpts or index references; much of the runtime wiring remains unverified.
Main entry points: ContextSave.c Context Save · ContextLoad.c Context Load · Marshal_ContextLoad.c Command Marshalling · CommandDispatcher.c Command Dispatcher
Components 22
TPM Commands
- Context Save
ContextSave.c - Context Load
ContextLoad.c - Start Auth Session
StartAuthSession.c - Policy Commands
PolicyAuthorize.c - Session Audit Digest
GetSessionAuditDigest.c - Object Authorization
ObjectChangeAuth.c - NV Storage Commands
NV.c - PCR Commands
PCR.c
TPM State
- Context Protection
Context_spt.c - Session Management
Session.c - Session Authorization
SessionProcess.c - Global TPM State
Global.h
Cryptography
- Crypto Utilities
CryptUtil_fp.h - RSA Primitives
CpriRSA_fp.h
Runtime Support
- Command Marshalling
Marshal_ContextLoad.c - Command Dispatcher
CommandDispatcher.c - Generated Types
tpm_generated.h - Memory Helpers
MemoryLib_fp.h - TPM Internals
Implementation.h
Simulator Platform
- Platform Services
Platform.h - TCP Simulator
TcpServer.c
Other components
- TPM Client
Connections 11
- Context Save → Context Protection: uses protection
Context_spt.c - Context Load → Context Protection: uses protection
Context_spt.c - Start Auth Session → Session Management: creates session
StartAuthSession.c - Context Save → Global TPM State: reads state
ContextSave.c - Context Load → Global TPM State: updates state
ContextLoad.c - Context Save → Memory Helpers: copies context
ContextSave.c - Context Load → Memory Helpers: compares context
ContextLoad.c - TPM Client → TCP Simulator: sends requests
- TCP Simulator → Command Dispatcher: dispatches commands
- Command Dispatcher → Command Marshalling: routes commands
- Command Marshalling → Generated Types: uses types
Marshal_ContextLoad.c