1tpm2_pcrevent(1) General Commands Manual tpm2_pcrevent(1)
2
3
4
6 tpm2_pcrevent(1) - hashes a file and optionally extends a pcr.
7
9 tpm2_pcrevent [OPTIONS] [FILE]
10
12 tpm2_pcrevent(1) hashes FILE if specified or stdin. It uses all of the
13 hashing algorithms that the tpm supports. Optionally, if a pcr index
14 is specified, it extends that pcr for all supported algorithms with the
15 hash digest. In either case, it outputs to stdout the hash algorithm
16 used and the digest value, one per line:
17
18 alg:digest
19
20 Where alg is the algorithm used (eg. sha1) and digest is the digest
21 resulting from the hash computation of alg on the data.
22
23 See sections 23.1 and sections 17 of the TPM2.0 Specification
24 (https://trustedcomputinggroup.org/wp-content/uploads/TPM-
25 Rev-2.0-Part-3-Commands-01.38.pdf)
26
28 These options control extending the pcr:
29
30 · -i, –pcr-index=INDEX: Not only compute the hash digests on FILE, also
31 extend the pcr given by INDEX for all supported hash algorithms.
32
33 · -S, –input-session-handle=SESSION_HANDLE: Use SESSION_HANDLE for pro‐
34 viding an authorization session for the pcr specified by INDEX. It
35 is an error to specify -S without specifying a pcr index with -i.
36
37 · -P, –password=PASSWORD: Use PASSWORD for providing an authorization
38 value for the pcr specified in INDEX. It is an error to specify -P
39 without specifying a pcr index with -i.
40
42 This collection of options are common to many programs and provide in‐
43 formation that many users may expect.
44
45 · -h, –help: Display the tools manpage. This requires the manpages to
46 be installed or on MANPATH, See man(1) for more details.
47
48 · -v, –version: Display version information for this tool, supported
49 tctis and exit.
50
51 · -V, –verbose: Increase the information that the tool prints to the
52 console during its execution. When using this option the file and
53 line number are printed.
54
55 · -Q, –quiet: Silence normal tool output to stdout.
56
57 · -Z, –enable-errata: Enable the application of errata fixups. Useful
58 if an errata fixup needs to be applied to commands sent to the TPM.
59 # TCTI ENVIRONMENT
60
61 This collection of environment variables that may be used to configure
62 the various TCTI modules available.
63
64 The values passed through these variables can be overridden on a
65 per-command basis using the available command line options, see the TC‐
66 TI_OPTIONS section.
67
68 The variables respected depend on how the software was configured.
69
70 · TPM2TOOLS_TCTI_NAME: Select the TCTI used for communication with the
71 next component down the TSS stack. In most configurations this will
72 be the TPM but it could be a simulator or proxy. The current known
73 TCTIs are:
74
75 · tabrmd - The new resource manager, called tabrmd
76 (https://github.com/01org/tpm2-abrmd).
77
78 · socket - Typically used with the old resource manager, or talking
79 directly to a simulator.
80
81 · device - Used when talking directly to a TPM device file.
82
83 · TPM2TOOLS_DEVICE_FILE: When using the device TCTI, specify the TPM
84 device file. The default is “/dev/tpm0”.
85
86 Note: Using the tpm directly requires the users to ensure that con‐
87 current access does not occur and that they manage the tpm resources.
88 These tasks are usually managed by a resource manager. Linux 4.12
89 and greater supports an in kernel resource manager at “/dev/tpmrm”,
90 typically “/dev/tpmrm0”.
91
92 · TPM2TOOLS_SOCKET_ADDRESS: When using the socket TCTI, specify the do‐
93 main name or IP address used. The default is 127.0.0.1.
94
95 · TPM2TOOLS_SOCKET_PORT: When using the socket TCTI, specify the port
96 number used. The default is 2321.
97
99 This collection of options are used to configure the varous TCTI mod‐
100 ules available. They override any environment variables.
101
102 · -T, –tcti=TCTI_NAME[:TCTI_OPTIONS]: Select the TCTI used for communi‐
103 cation with the next component down the TSS stack. In most configu‐
104 rations this will be the resource manager: tabrmd
105 (https://github.com/01org/tpm2-abrmd) Optionally, tcti specific op‐
106 tions can appended to TCTI_NAME by appending a : to TCTI_NAME.
107
108 · For the device TCTI, the TPM device file for use by the device TCTI
109 can be specified. The default is /dev/tpm0. Example: -T de‐
110 vice:/dev/tpm0
111
112 · For the socket TCTI, the domain name or IP address and port number
113 used by the socket can be specified. The default are 127.0.0.1 and
114 2321. Example: -T socket:127.0.0.1:2321
115
116 · For the abrmd TCTI, it takes no options. Example: -T abrmd
117
119 Hash a file:
120
121 tpm2_pcrevent data
122
123 Hash a file and extend pcr 8:
124
125 tpm2_pcrevent -i 8 data
126
128 0 on success or 1 on failure.
129
131 Github Issues (https://github.com/01org/tpm2-tools/issues)
132
134 See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)
135
136
137
138tpm2-tools SEPTEMBER 2017 tpm2_pcrevent(1)