1tpm2_nvreadpublic(1) General Commands Manual tpm2_nvreadpublic(1)
2
3
4
6 tpm2_nvreadpublic(1) - Display all defined Non-Volatile (NV)s indices.
7
9 tpm2_nvreadpublic [OPTIONS]
10
12 tpm2_nvreadpublic(1) - Display all defined Non-Volatile (NV)s indices
13 to stdout in a YAML format.
14
15 Display metadata for all defined NV indices. Metadata includes:
16
17 • The size of the defined region.
18
19 • The hash algorithm used to compute the name of the index.
20
21 • The auth policy.
22
23 • The NV attributes as defined in section “NV Attributes”.
24
25 Example Output
26 0x1500015:
27 hash algorithm:
28 friendly: sha256
29 value: 0xB
30 attributes:
31 friendly: ownerwrite|ownerread
32 value: 0x2000200
33 size: 32
34 authorization policy:
35
36 0x1500017:
37 hash algorithm:
38 friendly: sha256
39 value: 0xB
40 attributes:
41 friendly: ownerwrite|ownerread
42 value: 0x2000200
43 size: 32
44 authorization policy:
45
47 This tool takes no tool specific options.
48
50 This collection of options are common to many programs and provide in‐
51 formation that many users may expect.
52
53 • -h, --help=[man|no-man]: Display the tools manpage. By default, it
54 attempts to invoke the manpager for the tool, however, on failure
55 will output a short tool summary. This is the same behavior if the
56 “man” option argument is specified, however if explicit “man” is re‐
57 quested, the tool will provide errors from man on stderr. If the
58 “no-man” option if specified, or the manpager fails, the short op‐
59 tions will be output to stdout.
60
61 To successfully use the manpages feature requires the manpages to be
62 installed or on MANPATH, See man(1) for more details.
63
64 • -v, --version: Display version information for this tool, supported
65 tctis and exit.
66
67 • -V, --verbose: Increase the information that the tool prints to the
68 console during its execution. When using this option the file and
69 line number are printed.
70
71 • -Q, --quiet: Silence normal tool output to stdout.
72
73 • -Z, --enable-errata: Enable the application of errata fixups. Useful
74 if an errata fixup needs to be applied to commands sent to the TPM.
75 Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
76
78 The TCTI or “Transmission Interface” is the communication mechanism
79 with the TPM. TCTIs can be changed for communication with TPMs across
80 different mediums.
81
82 To control the TCTI, the tools respect:
83
84 1. The command line option -T or --tcti
85
86 2. The environment variable: TPM2TOOLS_TCTI.
87
88 Note: The command line option always overrides the environment vari‐
89 able.
90
91 The current known TCTIs are:
92
93 • tabrmd - The resource manager, called tabrmd
94 (https://github.com/tpm2-software/tpm2-abrmd). Note that tabrmd and
95 abrmd as a tcti name are synonymous.
96
97 • mssim - Typically used for communicating to the TPM software simula‐
98 tor.
99
100 • device - Used when talking directly to a TPM device file.
101
102 • none - Do not initalize a connection with the TPM. Some tools allow
103 for off-tpm options and thus support not using a TCTI. Tools that do
104 not support it will error when attempted to be used without a TCTI
105 connection. Does not support ANY options and MUST BE presented as
106 the exact text of “none”.
107
108 The arguments to either the command line option or the environment
109 variable are in the form:
110
111 <tcti-name>:<tcti-option-config>
112
113 Specifying an empty string for either the <tcti-name> or <tcti-op‐
114 tion-config> results in the default being used for that portion respec‐
115 tively.
116
117 TCTI Defaults
118 When a TCTI is not specified, the default TCTI is searched for using
119 dlopen(3) semantics. The tools will search for tabrmd, device and
120 mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND. You can query
121 what TCTI will be chosen as the default by using the -v option to print
122 the version information. The “default-tcti” key-value pair will indi‐
123 cate which of the aforementioned TCTIs is the default.
124
125 Custom TCTIs
126 Any TCTI that implements the dynamic TCTI interface can be loaded. The
127 tools internally use dlopen(3), and the raw tcti-name value is used for
128 the lookup. Thus, this could be a path to the shared library, or a li‐
129 brary name as understood by dlopen(3) semantics.
130
132 This collection of options are used to configure the various known TCTI
133 modules available:
134
135 • device: For the device TCTI, the TPM character device file for use by
136 the device TCTI can be specified. The default is /dev/tpm0.
137
138 Example: -T device:/dev/tpm0 or export TPM2TOOLS_TCTI=“de‐
139 vice:/dev/tpm0”
140
141 • mssim: For the mssim TCTI, the domain name or IP address and port
142 number used by the simulator can be specified. The default are
143 127.0.0.1 and 2321.
144
145 Example: -T mssim:host=localhost,port=2321 or export TPM2TOOLS_TC‐
146 TI=“mssim:host=localhost,port=2321”
147
148 • abrmd: For the abrmd TCTI, the configuration string format is a se‐
149 ries of simple key value pairs separated by a `,' character. Each
150 key and value string are separated by a `=' character.
151
152 • TCTI abrmd supports two keys:
153
154 1. `bus_name' : The name of the tabrmd service on the bus (a
155 string).
156
157 2. `bus_type' : The type of the dbus instance (a string) limited to
158 `session' and `system'.
159
160 Specify the tabrmd tcti name and a config string of bus_name=com.ex‐
161 ample.FooBar:
162
163 \--tcti=tabrmd:bus_name=com.example.FooBar
164
165 Specify the default (abrmd) tcti and a config string of bus_type=ses‐
166 sion:
167
168 \--tcti:bus_type=session
169
170 NOTE: abrmd and tabrmd are synonymous.
171
173 NV Attributes are used to control various properties of the NV defined
174 space. When specified as an option, either the raw bitfield mask or
175 “nice-names” may be used. The values can be found in Table 204 Part 2
176 of the TPM2.0 specification, which can be found here:
177
178 <https://trustedcomputinggroup.org/wp-content/uploads/TPM-
179 Rev-2.0-Part-2-Structures-01.38.pdf>
180
181 Nice names are calculated by taking the name field of table 204 and re‐
182 moving the prefix TPMA_NV_ and lowercasing the result. Thus, TP‐
183 MA_NV_PPWRITE becomes ppwrite. Nice names can be joined using the bit‐
184 wise or “|” symbol.
185
186 Note that the TPM_NT field is 4 bits wide, and thus can be set via nt=
187 format. For instance, to set The fields TPMA_NV_OWNERREAD, TP‐
188 MA_NV_OWNERWRITE, TPMA_NV_POLICYWRITE, and TPMA_NT = 0x2, the argument
189 would be:
190
191 ownerread|ownerwrite|policywrite|nt=0x2
192
193 Additionally, the NT field, which denotes the type of the NV index, can
194 also be specified via friendly names: * ordinary - Ordinary contains
195 data that is opaque to the TPM that can only be modified using
196 TPM2_NV_Write. * extend - Extend is used similarly to a PCR and can
197 only be modified with TPM2_NV_Extend. Its size is determined by the
198 length of the hash algorithm used. * counter - Counter contains an
199 8-octet value that is to be used as a counter and can only be modified
200 with TPM2_NV_Increment * bits - Bit Field contains an 8-octet value to
201 be used as a bit field and can only be modified with TPM2_NV_SetBits.
202 * pinfail - PIN Fail contains an 8-octet pinCount that increments on a
203 PIN authorization failure and a pinLimit. * pinpass - PIN Pass con‐
204 tains an 8-octet pinCount that increments on a PIN authorization suc‐
205 cess and a pinLimit.
206
207 For instance, to set The fields TPMA_NV_OWNERREAD, TPMA_NV_OWNERWRITE,
208 TPMA_NV_POLICYWRITE, and TPMA_NT = bits, the argument would be:
209
210 ownerread|ownerwrite|policywrite|nt=bits
211
213 List the defined NV indices to stdout
214 tpm2_nvreadpublic
215
217 Tools can return any of the following codes:
218
219 • 0 - Success.
220
221 • 1 - General non-specific error.
222
223 • 2 - Options handling error.
224
225 • 3 - Authentication error.
226
227 • 4 - TCTI related error.
228
229 • 5 - Non supported scheme. Applicable to tpm2_testparams.
230
232 Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
233
235 See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)
236
237
238
239tpm2-tools tpm2_nvreadpublic(1)