1tpm2_send(1)                General Commands Manual               tpm2_send(1)
2
3
4

NAME

6       tpm2_send(1) - Send a raw command buffer to the TPM.
7

SYNOPSIS

9       tpm2_send [OPTIONS] [STDIN]
10

DESCRIPTION

12       tpm2_send(1)  -  Sends  a  TPM command to the TPM.  The command is read
13       from a file as a binary stream and transmitted to the TPM using the TC‐
14       TI  specified  by  the  caller.   The response received from the TPM is
15       written to the output file.
16
17       Likely the caller will want to redirect this to a file or into  a  pro‐
18       gram to decode and display the response in a human readable form.
19

OPTIONS

21-o, --output=FILE:
22
23         Output file to send response buffer to.  Defaults to STDOUT.
24
25       • **_STDIN** the file containing the TPM2 command.
26
27   References

COMMON OPTIONS

29       This  collection of options are common to many programs and provide in‐
30       formation that many users may expect.
31
32-h, --help=[man|no-man]: Display the tools manpage.  By  default,  it
33         attempts  to  invoke  the  manpager for the tool, however, on failure
34         will output a short tool summary.  This is the same behavior  if  the
35         “man”  option argument is specified, however if explicit “man” is re‐
36         quested, the tool will provide errors from man  on  stderr.   If  the
37         “no-man”  option  if  specified, or the manpager fails, the short op‐
38         tions will be output to stdout.
39
40         To successfully use the manpages feature requires the manpages to  be
41         installed or on MANPATH, See man(1) for more details.
42
43-v,  --version:  Display version information for this tool, supported
44         tctis and exit.
45
46-V, --verbose: Increase the information that the tool prints  to  the
47         console  during  its  execution.  When using this option the file and
48         line number are printed.
49
50-Q, --quiet: Silence normal tool output to stdout.
51
52-Z, --enable-errata: Enable the application of errata fixups.  Useful
53         if  an  errata fixup needs to be applied to commands sent to the TPM.
54         Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.   in‐
55         formation many users may expect.
56

TCTI Configuration

58       The  TCTI  or  “Transmission  Interface” is the communication mechanism
59       with the TPM.  TCTIs can be changed for communication with TPMs  across
60       different mediums.
61
62       To control the TCTI, the tools respect:
63
64       1. The command line option -T or --tcti
65
66       2. The environment variable: TPM2TOOLS_TCTI.
67
68       Note:  The  command  line option always overrides the environment vari‐
69       able.
70
71       The current known TCTIs are:
72
73       • tabrmd     -     The     resource     manager,     called      tabrmd
74         (https://github.com/tpm2-software/tpm2-abrmd).   Note that tabrmd and
75         abrmd as a tcti name are synonymous.
76
77       • mssim - Typically used for communicating to the TPM software  simula‐
78         tor.
79
80       • device - Used when talking directly to a TPM device file.
81
82       • none  - Do not initalize a connection with the TPM.  Some tools allow
83         for off-tpm options and thus support not using a TCTI.  Tools that do
84         not  support  it  will error when attempted to be used without a TCTI
85         connection.  Does not support ANY options and MUST  BE  presented  as
86         the exact text of “none”.
87
88       The  arguments  to  either  the  command line option or the environment
89       variable are in the form:
90
91       <tcti-name>:<tcti-option-config>
92
93       Specifying an empty string for  either  the  <tcti-name>  or  <tcti-op‐
94       tion-config> results in the default being used for that portion respec‐
95       tively.
96
97   TCTI Defaults
98       When a TCTI is not specified, the default TCTI is  searched  for  using
99       dlopen(3)  semantics.   The  tools  will  search for tabrmd, device and
100       mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND.  You  can  query
101       what TCTI will be chosen as the default by using the -v option to print
102       the version information.  The “default-tcti” key-value pair will  indi‐
103       cate which of the aforementioned TCTIs is the default.
104
105   Custom TCTIs
106       Any TCTI that implements the dynamic TCTI interface can be loaded.  The
107       tools internally use dlopen(3), and the raw tcti-name value is used for
108       the lookup.  Thus, this could be a path to the shared library, or a li‐
109       brary name as understood by dlopen(3) semantics.
110

TCTI OPTIONS

112       This collection of options are used to configure the various known TCTI
113       modules available:
114
115device: For the device TCTI, the TPM character device file for use by
116         the device TCTI can be specified.  The default is /dev/tpm0.
117
118         Example:   -T   device:/dev/tpm0   or   export    TPM2TOOLS_TCTI=“de‐
119         vice:/dev/tpm0”
120
121mssim:  For  the  mssim  TCTI, the domain name or IP address and port
122         number used by the simulator  can  be  specified.   The  default  are
123         127.0.0.1 and 2321.
124
125         Example:  -T  mssim:host=localhost,port=2321  or export TPM2TOOLS_TC‐
126         TI=“mssim:host=localhost,port=2321”
127
128abrmd: For the abrmd TCTI, the configuration string format is  a  se‐
129         ries  of  simple  key value pairs separated by a `,' character.  Each
130         key and value string are separated by a `=' character.
131
132         • TCTI abrmd supports two keys:
133
134           1. `bus_name' : The name of  the  tabrmd  service  on  the  bus  (a
135              string).
136
137           2. `bus_type' : The type of the dbus instance (a string) limited to
138              `session' and `system'.
139
140         Specify the tabrmd tcti name and a config string of  bus_name=com.ex‐
141         ample.FooBar:
142
143                \--tcti=tabrmd:bus_name=com.example.FooBar
144
145         Specify the default (abrmd) tcti and a config string of bus_type=ses‐
146         sion:
147
148                \--tcti:bus_type=session
149
150         NOTE: abrmd and tabrmd are synonymous.  the various known  TCTI  mod‐
151         ules.
152

EXAMPLES

154   Send and receive raw commands to TPM
155       Send  the  contents of tpm2-command.bin to a device and collect the re‐
156       sponse as tpm2-response.bin.
157
158              tpm2_send < tpm2-command.bin > tpm2-response.bin
159
160              tpm2_send < tpm2-command.bin -o tpm2-response.bin
161

Returns

163       Tools can return any of the following codes:
164
165       • 0 - Success.
166
167       • 1 - General non-specific error.
168
169       • 2 - Options handling error.
170
171       • 3 - Authentication error.
172
173       • 4 - TCTI related error.
174
175       • 5 - Non supported scheme.  Applicable to tpm2_testparams.
176

BUGS

178       Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
179

HELP

181       See the Mailing List (https://lists.linuxfoundation.org/mailman/listin
182       fo/tpm2)
183
184
185
186tpm2-tools                                                        tpm2_send(1)
Impressum