tpm2_send.1 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_send" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_send\f[](1) \- Send a raw command buffer to the TPM.
  8. .SH SYNOPSIS
  9. .PP
  10. \f[B]tpm2_send\f[] [\f[I]OPTIONS\f[]] [\f[I]STDIN\f[]]
  11. .SH DESCRIPTION
  12. .PP
  13. \f[B]tpm2_send\f[](1) \- Sends a TPM command to the TPM.
  14. The command is read from a file as a binary stream and transmitted to
  15. the TPM using the TCTI specified by the caller.
  16. The response received from the TPM is written to the output file.
  17. .PP
  18. Likely the caller will want to redirect this to a file or into a program
  19. to decode and display the response in a human readable form.
  20. .SH OPTIONS
  21. .IP \[bu] 2
  22. \f[B]\-o\f[], \f[B]\-\-output\f[]=\f[I]FILE\f[]:
  23. .RS 2
  24. .PP
  25. Output file to send response buffer to.
  26. Defaults to \f[I]STDOUT\f[].
  27. .RE
  28. .IP \[bu] 2
  29. **_STDIN** the file containing the TPM2 command.
  30. .SS References
  31. .SH COMMON OPTIONS
  32. .PP
  33. This collection of options are common to many programs and provide
  34. information that many users may expect.
  35. .IP \[bu] 2
  36. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  37. manpage.
  38. By default, it attempts to invoke the manpager for the tool, however, on
  39. failure will output a short tool summary.
  40. This is the same behavior if the "man" option argument is specified,
  41. however if explicit "man" is requested, the tool will provide errors
  42. from man on stderr.
  43. If the "no\-man" option if specified, or the manpager fails, the short
  44. options will be output to stdout.
  45. .RS 2
  46. .PP
  47. To successfully use the manpages feature requires the manpages to be
  48. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  49. .RE
  50. .IP \[bu] 2
  51. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  52. tool, supported tctis and exit.
  53. .IP \[bu] 2
  54. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  55. tool prints to the console during its execution.
  56. When using this option the file and line number are printed.
  57. .IP \[bu] 2
  58. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  59. .IP \[bu] 2
  60. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  61. errata fixups.
  62. Useful if an errata fixup needs to be applied to commands sent to the
  63. TPM.
  64. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  65. information many users may expect.
  66. .SH TCTI Configuration
  67. .PP
  68. The TCTI or "Transmission Interface" is the communication mechanism with
  69. the TPM.
  70. TCTIs can be changed for communication with TPMs across different
  71. mediums.
  72. .PP
  73. To control the TCTI, the tools respect:
  74. .IP "1." 3
  75. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  76. .IP "2." 3
  77. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  78. .PP
  79. \f[B]Note:\f[] The command line option always overrides the environment
  80. variable.
  81. .PP
  82. The current known TCTIs are:
  83. .IP \[bu] 2
  84. tabrmd \- The resource manager, called
  85. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  86. Note that tabrmd and abrmd as a tcti name are synonymous.
  87. .IP \[bu] 2
  88. mssim \- Typically used for communicating to the TPM software simulator.
  89. .IP \[bu] 2
  90. device \- Used when talking directly to a TPM device file.
  91. .IP \[bu] 2
  92. none \- Do not initalize a connection with the TPM.
  93. Some tools allow for off\-tpm options and thus support not using a TCTI.
  94. Tools that do not support it will error when attempted to be used
  95. without a TCTI connection.
  96. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  97. the exact text of "none".
  98. .PP
  99. The arguments to either the command line option or the environment
  100. variable are in the form:
  101. .PP
  102. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  103. .PP
  104. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  105. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  106. that portion respectively.
  107. .SS TCTI Defaults
  108. .PP
  109. When a TCTI is not specified, the default TCTI is searched for using
  110. \f[I]dlopen(3)\f[] semantics.
  111. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  112. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  113. FOUND\f[].
  114. You can query what TCTI will be chosen as the default by using the
  115. \f[B]\-v\f[] option to print the version information.
  116. The "default\-tcti" key\-value pair will indicate which of the
  117. aforementioned TCTIs is the default.
  118. .SS Custom TCTIs
  119. .PP
  120. Any TCTI that implements the dynamic TCTI interface can be loaded.
  121. The tools internally use \f[I]dlopen(3)\f[], and the raw
  122. \f[I]tcti\-name\f[] value is used for the lookup.
  123. Thus, this could be a path to the shared library, or a library name as
  124. understood by \f[I]dlopen(3)\f[] semantics.
  125. .SH TCTI OPTIONS
  126. .PP
  127. This collection of options are used to configure the various known TCTI
  128. modules available:
  129. .IP \[bu] 2
  130. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  131. use by the device TCTI can be specified.
  132. The default is \f[I]/dev/tpm0\f[].
  133. .RS 2
  134. .PP
  135. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  136. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  137. .RE
  138. .IP \[bu] 2
  139. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  140. port number used by the simulator can be specified.
  141. The default are 127.0.0.1 and 2321.
  142. .RS 2
  143. .PP
  144. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  145. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  146. .RE
  147. .IP \[bu] 2
  148. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  149. series of simple key value pairs separated by a \[aq],\[aq] character.
  150. Each key and value string are separated by a \[aq]=\[aq] character.
  151. .RS 2
  152. .IP \[bu] 2
  153. TCTI abrmd supports two keys:
  154. .RS 2
  155. .IP "1." 3
  156. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  157. string).
  158. .IP "2." 3
  159. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  160. \[aq]session\[aq] and \[aq]system\[aq].
  161. .RE
  162. .PP
  163. Specify the tabrmd tcti name and a config string of
  164. \f[C]bus_name=com.example.FooBar\f[]:
  165. .PP
  166. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  167. .PP
  168. Specify the default (abrmd) tcti and a config string of
  169. \f[C]bus_type=session\f[]:
  170. .PP
  171. \f[C]\\\-\-tcti:bus_type=session\f[]
  172. .PP
  173. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  174. the various known TCTI modules.
  175. .RE
  176. .SH EXAMPLES
  177. .SS Send and receive raw commands to TPM
  178. .PP
  179. Send the contents of \f[I]tpm2\-command.bin\f[] to a device and collect
  180. the response as \f[I]tpm2\-response.bin\f[].
  181. .IP
  182. .nf
  183. \f[C]
  184. tpm2_send\ <\ tpm2\-command.bin\ >\ tpm2\-response.bin
  185. tpm2_send\ <\ tpm2\-command.bin\ \-o\ tpm2\-response.bin
  186. \f[]
  187. .fi
  188. .SH Returns
  189. .PP
  190. Tools can return any of the following codes:
  191. .IP \[bu] 2
  192. 0 \- Success.
  193. .IP \[bu] 2
  194. 1 \- General non\-specific error.
  195. .IP \[bu] 2
  196. 2 \- Options handling error.
  197. .IP \[bu] 2
  198. 3 \- Authentication error.
  199. .IP \[bu] 2
  200. 4 \- TCTI related error.
  201. .IP \[bu] 2
  202. 5 \- Non supported scheme.
  203. Applicable to tpm2_testparams.
  204. .SH BUGS
  205. .PP
  206. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  207. .SH HELP
  208. .PP
  209. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)