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