blob: 6b2c80381852dc51e369acadb0e8c47006e5bfd8 [file] [log] [blame]
This project is the front end for a software TPM 2.0. It exposes libtpm2
(src/third_party/tpm2) as two file descriptors to accept commands from a client.
The main loop waits for requests on /dev/tpm-req, and writes responses to
/dev/tpm-resp. All reads and writes are synchronous. A client should read and
write to these file descriptors with the read() and write() syscalls. Multiple
clients using the simulator simultaneously is undefined behavior. The main loop
only exits when it receives an erroneous command.
Execute 'tpm2-simulator' as root to inialize the software TPM and wait for
An example of how a client can use 'tpm2-simulator' is in /src/platform2/trunks.
See trunks::TpmSimulatorHandle. To use trunks with the software TPM, start the
trunks daemon as root with the --simulator flag.
---- Notes ----
* Because third_party/tpm2 builds a static library, if a change is made to any
file in /src/third_party/tpm2, /src/platform2/tpm2-simulator must be forcibly
rebuilt to refect this change.
* If the simulator ever goes into lockout, failure, or other erroneous mode,
remove NVChip.