tree: bcf4c5ecbe019bc30c6d48692a29e52e9a3bf625 [path history] [tgz]
  1. BUILD.gn
  2. CPPLINT.cfg
  3. Makefile
  4. OWNERS
  5. README.md
  6. authorization_delegate.h
  7. background_command_transceiver.cc
  8. background_command_transceiver.h
  9. background_command_transceiver_test.cc
  10. blob_parser.cc
  11. blob_parser.h
  12. com.android.Trunks.conf
  13. command_transceiver.h
  14. creation_blob_fuzzer.cc
  15. dbus_interface.h
  16. error_codes.cc
  17. error_codes.h
  18. ftdi/
  19. fuzzed_command_transceiver.cc
  20. fuzzed_command_transceiver.h
  21. generator/
  22. hmac_authorization_delegate.cc
  23. hmac_authorization_delegate.h
  24. hmac_authorization_delegate_fuzzer.cc
  25. hmac_authorization_delegate_test.cc
  26. hmac_session.h
  27. hmac_session_impl.cc
  28. hmac_session_impl.h
  29. hmac_session_test.cc
  30. interface.proto
  31. key_blob_fuzzer.cc
  32. mock_authorization_delegate.cc
  33. mock_authorization_delegate.h
  34. mock_blob_parser.cc
  35. mock_blob_parser.h
  36. mock_command_transceiver.cc
  37. mock_command_transceiver.h
  38. mock_dbus_bus.h
  39. mock_hmac_session.cc
  40. mock_hmac_session.h
  41. mock_policy_session.cc
  42. mock_policy_session.h
  43. mock_resource_manager.h
  44. mock_session_manager.cc
  45. mock_session_manager.h
  46. mock_tpm.cc
  47. mock_tpm.h
  48. mock_tpm_cache.cc
  49. mock_tpm_cache.h
  50. mock_tpm_state.cc
  51. mock_tpm_state.h
  52. mock_tpm_utility.cc
  53. mock_tpm_utility.h
  54. openssl_utility.cc
  55. openssl_utility.h
  56. openssl_utility_test.cc
  57. org.chromium.Trunks.conf
  58. password_authorization_delegate.cc
  59. password_authorization_delegate.h
  60. password_authorization_delegate_fuzzer.cc
  61. password_authorization_delegate_test.cc
  62. pinweaver.proto
  63. pinweaver_client.cc
  64. policy_session.h
  65. policy_session_impl.cc
  66. policy_session_impl.h
  67. policy_session_test.cc
  68. power_manager.cc
  69. power_manager.h
  70. power_manager_test.cc
  71. resource_manager.cc
  72. resource_manager.h
  73. resource_manager_fuzzer.cc
  74. resource_manager_test.cc
  75. scoped_global_session.h
  76. scoped_global_session_test.cc
  77. scoped_key_handle.cc
  78. scoped_key_handle.h
  79. scoped_key_handle_test.cc
  80. session_manager.h
  81. session_manager_impl.cc
  82. session_manager_impl.h
  83. session_manager_test.cc
  84. tpm_alerts.h
  85. tpm_cache.h
  86. tpm_cache_impl.cc
  87. tpm_cache_impl.h
  88. tpm_cache_test.cc
  89. tpm_constants.h
  90. tpm_extended.cc
  91. tpm_generated.cc
  92. tpm_generated.h
  93. tpm_generated_test.cc
  94. tpm_handle.cc
  95. tpm_handle.h
  96. tpm_pinweaver.cc
  97. tpm_pinweaver.h
  98. tpm_pinweaver_fuzzer.cc
  99. tpm_simulator_handle.cc
  100. tpm_simulator_handle.h
  101. tpm_state.h
  102. tpm_state_impl.cc
  103. tpm_state_impl.h
  104. tpm_state_test.cc
  105. tpm_utility.h
  106. tpm_utility_impl.cc
  107. tpm_utility_impl.h
  108. tpm_utility_test.cc
  109. tpm_version
  110. trunks_client.cc
  111. trunks_client_test.cc
  112. trunks_client_test.h
  113. trunks_dbus_proxy.cc
  114. trunks_dbus_proxy.h
  115. trunks_dbus_proxy_test.cc
  116. trunks_dbus_service.cc
  117. trunks_dbus_service.h
  118. trunks_export.h
  119. trunks_factory.h
  120. trunks_factory_for_test.cc
  121. trunks_factory_for_test.h
  122. trunks_factory_impl.cc
  123. trunks_factory_impl.h
  124. trunks_factory_test.cc
  125. trunks_ftdi_spi.cc
  126. trunks_ftdi_spi.h
  127. trunks_send.cc
  128. trunks_testrunner.cc
  129. trunksd-seccomp-amd64.policy
  130. trunksd-seccomp-arm.policy
  131. trunksd-seccomp-arm64.policy
  132. trunksd-seccomp-mips.policy
  133. trunksd-seccomp-x86.policy
  134. trunksd-seccomp-x86_64.policy
  135. trunksd-simulator.rc
  136. trunksd.cc
  137. trunksd.conf
  138. trunksd.conf.cr50
  139. trunksd.conf.tpm2_simulator
  140. trunksd.rc
trunks/README.md

Trunks

Trunks is a daemon and library for interfacing with a Trusted Platform Module (TPM).

Be aware that trunks does not comply with the Trusted Computing Group (TCG) Software Stack (TSS) specification.

Components

trunksd

A daemon that centralizes access by other system daemons to a single shared TPM. Other daemons send D-Bus requests to trunksd with TPM commands, trunksd sends them through /dev/tpm0 (which can only be opened by a single process) and responds over D-Bus with the TPM response.

Trunksd also performs resource management for the TPM, loading and unloading objects transparently for the calling daemons.

libtrunks

The calling-daemon side shared library that provides a C++ API for serializing and deserializing various TPM commands and performing higher-level operations.

It is possible to use libtrunks independent of trunksd by providing a custom CommandTransceiver to perform communication directly with a TPM, but the default scenario is when libtrunks and trunksd are used together and communicate over a D-Bus based transceiver.

TPM Specification

See http://www.trustedcomputinggroup.org. This version of trunks is based on TPM 2.0 rev 00.99.

Structures

generator/raw_structures.txt

generator/raw_structures_fixed.txt

This file is a direct PDF scrape (*) of ‘Part 2 - Structures’. The _fixed version includes some manual fixes to make processing easier.

Commands

generator/raw_commands.txt

generator/raw_commands_fixed.txt

This file is a direct PDF scrape (*) of ‘Part 3 - Commands’. The _fixed version includes some manual fixes to make processing easier.

(*) Scraping for this version of trunks used Poppler's pdftotext utility v0.18.4.

Code Generation

generator/extract_structures.sh

Extracts structured information about types, constants, structures, and unions from generator/raw_structures_fixed.txt. The output of this script is intended to be parsed by generator.py.

generator/extract_commands.sh

Extracts structured information about commands from generator/raw_commands_fixed.txt. The output of this script is intended to be parsed by generator.py.

generator/generator.py

Generates C++ serialization and parsing code for TPM commands. Inputs must be formatted as by the extract_* scripts.