tree: 7751f7bb5459651b1c827e9e035faa33b278727c [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_test.cc
  25. hmac_session.h
  26. hmac_session_impl.cc
  27. hmac_session_impl.h
  28. hmac_session_test.cc
  29. interface.proto
  30. key_blob_fuzzer.cc
  31. libtrunks.pc.in
  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_dbus_object_proxy.h
  40. mock_hmac_session.cc
  41. mock_hmac_session.h
  42. mock_policy_session.cc
  43. mock_policy_session.h
  44. mock_resource_manager.h
  45. mock_session_manager.cc
  46. mock_session_manager.h
  47. mock_tpm.cc
  48. mock_tpm.h
  49. mock_tpm_state.cc
  50. mock_tpm_state.h
  51. mock_tpm_utility.cc
  52. mock_tpm_utility.h
  53. org.chromium.Trunks.conf
  54. password_authorization_delegate.cc
  55. password_authorization_delegate.h
  56. password_authorization_delegate_test.cc
  57. pinweaver.proto
  58. pinweaver_client.cc
  59. policy_session.h
  60. policy_session_impl.cc
  61. policy_session_impl.h
  62. policy_session_test.cc
  63. power_manager.cc
  64. power_manager.h
  65. power_manager_test.cc
  66. resource_manager.cc
  67. resource_manager.h
  68. resource_manager_fuzzer.cc
  69. resource_manager_test.cc
  70. scoped_global_session.h
  71. scoped_global_session_test.cc
  72. scoped_key_handle.cc
  73. scoped_key_handle.h
  74. scoped_key_handle_test.cc
  75. session_manager.h
  76. session_manager_impl.cc
  77. session_manager_impl.h
  78. session_manager_test.cc
  79. tpm_alerts.h
  80. tpm_constants.h
  81. tpm_generated.cc
  82. tpm_generated.h
  83. tpm_generated_test.cc
  84. tpm_handle.cc
  85. tpm_handle.h
  86. tpm_pinweaver.cc
  87. tpm_pinweaver.h
  88. tpm_simulator_handle.cc
  89. tpm_simulator_handle.h
  90. tpm_state.h
  91. tpm_state_impl.cc
  92. tpm_state_impl.h
  93. tpm_state_test.cc
  94. tpm_utility.h
  95. tpm_utility_impl.cc
  96. tpm_utility_impl.h
  97. tpm_utility_test.cc
  98. tpm_version
  99. trunks_client.cc
  100. trunks_client_test.cc
  101. trunks_client_test.h
  102. trunks_dbus_proxy.cc
  103. trunks_dbus_proxy.h
  104. trunks_dbus_proxy_test.cc
  105. trunks_dbus_service.cc
  106. trunks_dbus_service.h
  107. trunks_export.h
  108. trunks_factory.h
  109. trunks_factory_for_test.cc
  110. trunks_factory_for_test.h
  111. trunks_factory_impl.cc
  112. trunks_factory_impl.h
  113. trunks_factory_test.cc
  114. trunks_ftdi_spi.cc
  115. trunks_ftdi_spi.h
  116. trunks_send.cc
  117. trunks_testrunner.cc
  118. trunksd-seccomp-amd64.policy
  119. trunksd-seccomp-arm.policy
  120. trunksd-seccomp-arm64.policy
  121. trunksd-seccomp-mips.policy
  122. trunksd-seccomp-x86.policy
  123. trunksd-seccomp-x86_64.policy
  124. trunksd-simulator.rc
  125. trunksd.cc
  126. trunksd.conf
  127. trunksd.conf.cr50
  128. trunksd.conf.tpm2_simulator
  129. 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.