[resourcemgr]fix for Tss2_Sys_ContextSave(session)

Execute tpmtest with resourcemgr connected to simulator, then follow the hint to run all tests in 2 - STARTUP TESTS, then run all tests in 10 - START_AUTH_SESSION TESTS, will get failure code 0xCF802(TSS2_RESMGR_FIND_FAILED).

The root cause is that the in memory context will be flushed after running savecontext for a session, so the original code try to prevent resourcemgr automatically evicting the context again via setting foundEntryPtr->status.loaded = 0. But this will cause the final call to EvictEntities failed.

The solution is to avoid calling into EvictEntities for Tss2_Sys_ContextSave(session) case while adding more if conditions.
1 file changed
tree: 6499a2efb99ffbb348f5874719ab57fd77e5f7b7
  1. common/
  2. resourcemgr/
  3. sysapi/
  4. tcti/
  5. test/
  6. .gitattributes
  7. .gitignore
  8. arch.md
  9. archandlayout.md
  10. bootstrap
  11. buildwindows.md
  12. ChangeLog
  13. configure.ac
  14. INSTALL
  15. layout.md
  16. LICENSE
  17. Makefile.am
  18. README.md
  19. run.md
  20. simulator.md
  21. TSS block diagram.png
  22. TSS layout.png
  23. tss.sln
  24. tss.vcxproj
README.md

TPM (Trusted Platform Module) 2.0 Software Stack (TSS):

This stack consists of the following layers from top to bottom:

  • Feature API (FAPI), see specification 0.12, (published but still in progress and unimplemented)
  • Enhanced System API (ESAPI), (specification in progress and unimplemented)
  • System API (SAPI), see 1.0 specification, (public, 0.97 implementation complete). This layer implements the system layer API level of the TSS 2.0 specification. These functions can be used to access all TPM 2.0 functions as described in Part 3 of the TPM 2.0 specification. The usefulness of this code extends to all users of the TPM, even those not planning to use the upper layers of the TSS.
  • TPM Command Transmission Interface (TCTI), used by SAPI to communicate with next lower layer (either the TAB/RM or TPM 2.0 device driver), see SAPI specification
  • Trusted Access Broker/Resource Manager (TAB/RM), see 0.91 specification, (public, implementation complete). This layer sits between the system API library code and the TPM. It is a daemon that handles all multi-process coordination and manages the TPM's internal resources transparently to applications.

Since the FAPI and ESAPI haven't been implemented yet, this repository only contains the SAPI and layers below it, plus a test application for exercising the SAPI.

The test application, tpmclient, tests many of the commands against the TPM 2.0 simulator. The tpmclient application can be altered and used as a sandbox to test and develop any TPM 2.0 command sequences, and provides an excellent development and learning vehicle.

Build and Installation Instructions:

Run Instructions

Architecture/Block Diagram

Code Layout

Resources

TPM 2.0 specifications can be found at Trusted Computing Group.