1tpm2_pcrread(1) General Commands Manual tpm2_pcrread(1)
2
3
4
6 tpm2_pcrread(1) - List PCR values.
7
9 tpm2_pcrread [OPTIONS] PCR_LIST_OR_ALG
10
12 tpm2_pcrread(1) - Displays PCR values. Without any arguments,
13 tpm2_pcrread(1) outputs all PCRs and their hash banks. One can use
14 specify the hash algorithm or a pcr list as an argument to filter the
15 output.
16
17 To only output PCR banks with a given algorithm, specify the hashing
18 algorithm as the argument. Algorithms should follow the “formatting
19 standards”, see section “Algorithm Specifiers”. Also, see section
20 “Supported Hash Algorithms” for a list of supported hash algorithms.
21
22 To output a list of PCR banks (sha1, sha256, etc) and ids (0, 1, 2 etc)
23 specify a PCR selection list as the argument as specified via section
24 “PCR Bank Specifiers”.
25
26 Also read NOTES section below.
27
28 Output is written in a YAML format to stdout, with each algorithm fol‐
29 lowed by a PCR index and its value. As a simple example assume just
30 sha1 and sha256 support and only 1 PCR. The output would be:
31
32 $ tpm2_pcrread sha1:0+sha256:0
33 sha1 :
34 0 : 0000000000000000000000000000000000000003
35 sha256 :
36 0 : 0000000000000000000000000000000000000000000000000000000000000003
37
39 • -o, --output=FILE:
40
41 The output file to write the PCR values in binary format, optional.
42
43 • --cphash=FILE
44
45 File path to record the hash of the command parameters. This is com‐
46 monly termed as cpHash. NOTE: When this option is selected, The tool
47 will not actually execute the command, it simply returns a cpHash.
48
49 • -F, --pcrs_format=FORMAT:
50
51 Format selection for the binary blob in the PCR output file. `val‐
52 ues' will output a binary blob of the PCR values. `serialized' will
53 output a binary blob of the PCR values in the form of serialized data
54 structure in little endian format. Optional. Default is `values'.
55
57 This collection of options are common to many programs and provide in‐
58 formation that many users may expect.
59
60 • -h, --help=[man|no-man]: Display the tools manpage. By default, it
61 attempts to invoke the manpager for the tool, however, on failure
62 will output a short tool summary. This is the same behavior if the
63 “man” option argument is specified, however if explicit “man” is re‐
64 quested, the tool will provide errors from man on stderr. If the
65 “no-man” option if specified, or the manpager fails, the short op‐
66 tions will be output to stdout.
67
68 To successfully use the manpages feature requires the manpages to be
69 installed or on MANPATH, See man(1) for more details.
70
71 • -v, --version: Display version information for this tool, supported
72 tctis and exit.
73
74 • -V, --verbose: Increase the information that the tool prints to the
75 console during its execution. When using this option the file and
76 line number are printed.
77
78 • -Q, --quiet: Silence normal tool output to stdout.
79
80 • -Z, --enable-errata: Enable the application of errata fixups. Useful
81 if an errata fixup needs to be applied to commands sent to the TPM.
82 Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
83
85 The TCTI or “Transmission Interface” is the communication mechanism
86 with the TPM. TCTIs can be changed for communication with TPMs across
87 different mediums.
88
89 To control the TCTI, the tools respect:
90
91 1. The command line option -T or --tcti
92
93 2. The environment variable: TPM2TOOLS_TCTI.
94
95 Note: The command line option always overrides the environment vari‐
96 able.
97
98 The current known TCTIs are:
99
100 • tabrmd - The resource manager, called tabrmd
101 (https://github.com/tpm2-software/tpm2-abrmd). Note that tabrmd and
102 abrmd as a tcti name are synonymous.
103
104 • mssim - Typically used for communicating to the TPM software simula‐
105 tor.
106
107 • device - Used when talking directly to a TPM device file.
108
109 • none - Do not initalize a connection with the TPM. Some tools allow
110 for off-tpm options and thus support not using a TCTI. Tools that do
111 not support it will error when attempted to be used without a TCTI
112 connection. Does not support ANY options and MUST BE presented as
113 the exact text of “none”.
114
115 The arguments to either the command line option or the environment
116 variable are in the form:
117
118 <tcti-name>:<tcti-option-config>
119
120 Specifying an empty string for either the <tcti-name> or <tcti-op‐
121 tion-config> results in the default being used for that portion respec‐
122 tively.
123
124 TCTI Defaults
125 When a TCTI is not specified, the default TCTI is searched for using
126 dlopen(3) semantics. The tools will search for tabrmd, device and
127 mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND. You can query
128 what TCTI will be chosen as the default by using the -v option to print
129 the version information. The “default-tcti” key-value pair will indi‐
130 cate which of the aforementioned TCTIs is the default.
131
132 Custom TCTIs
133 Any TCTI that implements the dynamic TCTI interface can be loaded. The
134 tools internally use dlopen(3), and the raw tcti-name value is used for
135 the lookup. Thus, this could be a path to the shared library, or a li‐
136 brary name as understood by dlopen(3) semantics.
137
139 This collection of options are used to configure the various known TCTI
140 modules available:
141
142 • device: For the device TCTI, the TPM character device file for use by
143 the device TCTI can be specified. The default is /dev/tpm0.
144
145 Example: -T device:/dev/tpm0 or export TPM2TOOLS_TCTI=“de‐
146 vice:/dev/tpm0”
147
148 • mssim: For the mssim TCTI, the domain name or IP address and port
149 number used by the simulator can be specified. The default are
150 127.0.0.1 and 2321.
151
152 Example: -T mssim:host=localhost,port=2321 or export TPM2TOOLS_TC‐
153 TI=“mssim:host=localhost,port=2321”
154
155 • abrmd: For the abrmd TCTI, the configuration string format is a se‐
156 ries of simple key value pairs separated by a `,' character. Each
157 key and value string are separated by a `=' character.
158
159 • TCTI abrmd supports two keys:
160
161 1. `bus_name' : The name of the tabrmd service on the bus (a
162 string).
163
164 2. `bus_type' : The type of the dbus instance (a string) limited to
165 `session' and `system'.
166
167 Specify the tabrmd tcti name and a config string of bus_name=com.ex‐
168 ample.FooBar:
169
170 \--tcti=tabrmd:bus_name=com.example.FooBar
171
172 Specify the default (abrmd) tcti and a config string of bus_type=ses‐
173 sion:
174
175 \--tcti:bus_type=session
176
177 NOTE: abrmd and tabrmd are synonymous.
178
179 PCR bank specifiers (common/pcr.md)
180
182 Supported hash algorithms are:
183
184 • 0x4 or sha1 for TPM_ALG_SHA1
185
186 • 0xB or sha256 for TPM_ALG_SHA256 (default)
187
188 • 0xC or sha384 for TPM_ALG_SHA384
189
190 • 0xD or sha512 for TPM_ALG_SHA512
191
192 • 0x12 or sm3_256 for TPM_ALG_SM3_256
193
194 NOTE: Your TPM may not support all algorithms.
195
197 Options that take algorithms support “nice-names”.
198
199 There are two major algorithm specification string classes, simple and
200 complex. Only certain algorithms will be accepted by the TPM, based on
201 usage and conditions.
202
203 Simple specifiers
204 These are strings with no additional specification data. When creating
205 objects, non-specified portions of an object are assumed to defaults.
206 You can find the list of known “Simple Specifiers” below.
207
208 Asymmetric
209 • rsa
210
211 • ecc
212
213 Symmetric
214 • aes
215
216 • camellia
217
218 • sm4
219
220 Hashing Algorithms
221 • sha1
222
223 • sha256
224
225 • sha384
226
227 • sha512
228
229 • sm3_256
230
231 • sha3_256
232
233 • sha3_384
234
235 • sha3_512
236
237 Keyed Hash
238 • hmac
239
240 • xor
241
242 Signing Schemes
243 • rsassa
244
245 • rsapss
246
247 • ecdsa
248
249 • ecdaa
250
251 • ecschnorr
252
253 • sm2
254
255 Asymmetric Encryption Schemes
256 • oaep
257
258 • rsaes
259
260 • ecdh
261
262 Modes
263 • ctr
264
265 • ofb
266
267 • cbc
268
269 • cfb
270
271 • ecb
272
273 Misc
274 • null
275
276 Complex Specifiers
277 Objects, when specified for creation by the TPM, have numerous algo‐
278 rithms to populate in the public data. Things like type, scheme and
279 asymmetric details, key size, etc. Below is the general format for
280 specifying this data: <type>:<scheme>:<symmetric-details>
281
282 Type Specifiers
283 This portion of the complex algorithm specifier is required. The re‐
284 maining scheme and symmetric details will default based on the type
285 specified and the type of the object being created.
286
287 • aes - Default AES: aes128
288
289 • aes128<mode> - 128 bit AES with optional mode (ctr|ofb|cbc|cfb|ecb).
290 If mode is not specified, defaults to null.
291
292 • aes192<mode> - Same as aes128<mode>, except for a 192 bit key size.
293
294 • aes256<mode> - Same as aes128<mode>, except for a 256 bit key size.
295
296 • sm4 - Default SM4: sm4128
297
298 • sm4128 or sm4_128 <mode> - 128 bit SM4 with optional mode
299 (ctr|ofb|cbc|cfb|ecb). If mode is not specified, defaults to null.
300
301 • ecc - Elliptical Curve, defaults to ecc256.
302
303 • ecc192 or ecc_nist_p192 - 192 bit ECC NIST curve
304
305 • ecc224 or ecc_nist_p224 - 224 bit ECC NIST curve
306
307 • ecc256 or ecc_nist_p256 - 256 bit ECC NIST curve
308
309 • ecc384 or ecc_nist_p384 - 384 bit ECC NIST curve
310
311 • ecc521 or ecc_nist_p521 - 521 bit ECC NIST curve
312
313 • ecc_sm2 or ecc_sm2_p256 - 256 bit SM2 curve
314
315 • rsa - Default RSA: rsa2048
316
317 • rsa1024 - RSA with 1024 bit keysize.
318
319 • rsa2048 - RSA with 2048 bit keysize.
320
321 • rsa3072 - RSA with 3072 bit keysize.
322
323 • rsa4096 - RSA with 4096 bit keysize.
324
325 Scheme Specifiers
326 Next, is an optional field, it can be skipped.
327
328 Schemes are usually Signing Schemes or Asymmetric Encryption Schemes.
329 Most signing schemes take a hash algorithm directly following the sign‐
330 ing scheme. If the hash algorithm is missing, it defaults to sha256.
331 Some take no arguments, and some take multiple arguments.
332
333 Hash Optional Scheme Specifiers
334 These scheme specifiers are followed by a dash and a valid hash algo‐
335 rithm, For example: oaep-sha256.
336
337 • oaep
338
339 • ecdh
340
341 • rsassa
342
343 • rsapss
344
345 • ecdsa
346
347 • ecschnorr
348
349 • sm2
350
351 Multiple Option Scheme Specifiers
352 This scheme specifier is followed by a count (max size UINT16) then
353 followed by a dash(-) and a valid hash algorithm. * ecdaa For example,
354 ecdaa4-sha256. If no count is specified, it defaults to 4.
355
356 No Option Scheme Specifiers
357 This scheme specifier takes NO arguments. * rsaes
358
359 Symmetric Details Specifiers
360 This field is optional, and defaults based on the type of object being
361 created and it’s attributes. Generally, any valid Symmetric specifier
362 from the Type Specifiers list should work. If not specified, an asym‐
363 metric objects symmetric details defaults to aes128cfb.
364
365 Examples
366 Create an rsa2048 key with an rsaes asymmetric encryption scheme
367 tpm2_create -C parent.ctx -G rsa2048:rsaes -u key.pub -r key.priv
368
369 Create an ecc256 key with an ecdaa signing scheme with a count of 4 and
370 sha384 hash
371 /tpm2_create -C parent.ctx -G ecc256:ecdaa4-sha384 -u key.pub -r
372 key.priv
373
375 Display all PCR values
376 tpm2_pcrread
377
378 Display the PCR values with a specified bank
379 tpm2_pcrread sha1
380
381 Display the PCR values with specified banks and store in a file
382 tpm2_pcrread -o pcrs sha1:16,17,18+sha256:16,17,18
383
384 Display the supported PCR bank algorithms and exit
385 tpm2_pcrread
386
388 The maximum number of PCR that can be dumped at once is associated with
389 the maximum length of a bank.
390
391 On most TPMs, it means that this tool can dump up to 24 PCRs at once.
392
394 Tools can return any of the following codes:
395
396 • 0 - Success.
397
398 • 1 - General non-specific error.
399
400 • 2 - Options handling error.
401
402 • 3 - Authentication error.
403
404 • 4 - TCTI related error.
405
406 • 5 - Non supported scheme. Applicable to tpm2_testparams.
407
409 Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
410
412 See the Mailing List (https://lists.linuxfoundation.org/mailman/listin‐
413 fo/tpm2)
414
415
416
417tpm2-tools tpm2_pcrread(1)