1tpm2_nvundefine(1) General Commands Manual tpm2_nvundefine(1)
2
3
4
6 tpm2_nvundefine(1) - Delete a Non-Volatile (NV) index.
7
9 tpm2_nvundefine [OPTIONS] [ARGUMENT]
10
12 tpm2_nvundefine(1) - Deletes a Non-Volatile (NV) index that was previ‐
13 ously defined with tpm2_nvdefine(1). The index is specified as an ar‐
14 gument. It can be specified as raw handle or an offset value to the nv
15 handle range "TPM2_HR_NV_INDEX".
16
17 The tool is also capable of deleting NV indices with attribute TP‐
18 MA_NV_POLICY_DELETE, and the tool uses this attribute for the default
19 hierarchy to select when -C is missing. The default value for -C is
20 the "owner" hierarchy when TPMA_NV_POLICY_DELETE is clear and "plat‐
21 form" when TPMA_NV_POLICY_DELETE is set.
22
24 · -C, --hierarchy=OBJECT:
25 Specifies the hierarchy used to authorize. Supported options are:
26
27 · o for TPM_RH_OWNER
28
29 · p for TPM_RH_PLATFORM
30
31 · <num> where a hierarchy handle may be specified.
32
33 · -P, --auth=AUTH:
34
35 Specifies the authorization value for the hierarchy.
36
37 · -S, --session=POLICY_SESSION:
38
39 Specify a policy session to use when the NV index has attribute TP‐
40 MA_NV_POLICY_DELETE set.
41
42 · ARGUMENT the command line argument specifies the NV index or offset
43 number.
44
45 References
47 The type of a context object, whether it is a handle or file name, is
48 determined according to the following logic in-order:
49
50 · If the argument is a file path, then the file is loaded as a restored
51 TPM transient object.
52
53 · If the argument is a prefix match on one of:
54
55 · owner: the owner hierarchy
56
57 · platform: the platform hierarchy
58
59 · endorsement: the endorsement hierarchy
60
61 · lockout: the lockout control persistent object
62
63 · If the argument argument can be loaded as a number it will be treat
64 as a handle, e.g. 0x81010013 and used directly.OBJECT.
65
67 Authorization for use of an object in TPM2.0 can come in 3 different
68 forms: 1. Password 2. HMAC 3. Sessions
69
70 NOTE: "Authorizations default to the EMPTY PASSWORD when not speci‐
71 fied".
72
73 Passwords
74 Passwords are interpreted in the following forms below using prefix
75 identifiers.
76
77 Note: By default passwords are assumed to be in the string form when
78 they do not have a prefix.
79
80 String
81 A string password, specified by prefix "str:" or it's absence (raw
82 string without prefix) is not interpreted, and is directly used for au‐
83 thorization.
84
85 Examples
86 foobar
87 str:foobar
88
89 Hex-string
90 A hex-string password, specified by prefix "hex:" is converted from a
91 hexidecimal form into a byte array form, thus allowing passwords with
92 non-printable and/or terminal un-friendly characters.
93
94 Example
95 hex:0x1122334455667788
96
97 File
98 A file based password, specified be prefix "file:" should be the path
99 of a file containing the password to be read by the tool or a "-" to
100 use stdin. Storing passwords in files prevents information leakage,
101 passwords passed as options can be read from the process list or common
102 shell history features.
103
104 Examples
105 # to use stdin and be prompted
106 file:-
107
108 # to use a file from a path
109 file:path/to/password/file
110
111 # to echo a password via stdin:
112 echo foobar | tpm2_tool -p file:-
113
114 # to use a bash here-string via stdin:
115
116 tpm2_tool -p file:- <<< foobar
117
118 Sessions
119 When using a policy session to authorize the use of an object, prefix
120 the option argument with the session keyword. Then indicate a path to
121 a session file that was created with tpm2_startauthsession(1). Option‐
122 ally, if the session requires an auth value to be sent with the session
123 handle (eg policy password), then append a + and a string as described
124 in the Passwords section.
125
126 Examples
127 To use a session context file called session.ctx.
128
129 session:session.ctx
130
131 To use a session context file called session.ctx AND send the authvalue
132 mypassword.
133
134 session:session.ctx+mypassword
135
136 To use a session context file called session.ctx AND send the HEX auth‐
137 value 0x11223344.
138
139 session:session.ctx+hex:11223344
140
141 PCR Authorizations
142 You can satisfy a PCR policy using the "pcr:" prefix and the PCR mini‐
143 language. The PCR minilanguage is as follows:
144 <pcr-spec>=<raw-pcr-file>
145
146 The PCR spec is documented in in the section "PCR bank specifiers".
147
148 The raw-pcr-file is an optional the output of the raw PCR contents as
149 returned by tpm2_pcrread(1).
150
151 PCR bank specifiers (common/pcr.md)
152
153 Examples
154 To satisfy a PCR policy of sha256 on banks 0, 1, 2 and 3 use a specifi‐
155 er of:
156
157 pcr:sha256:0,1,2,3
158
159 specifying AUTH.
160
162 This collection of options are common to many programs and provide in‐
163 formation that many users may expect.
164
165 · -h, --help=[man|no-man]: Display the tools manpage. By default, it
166 attempts to invoke the manpager for the tool, however, on failure
167 will output a short tool summary. This is the same behavior if the
168 "man" option argument is specified, however if explicit "man" is re‐
169 quested, the tool will provide errors from man on stderr. If the
170 "no-man" option if specified, or the manpager fails, the short op‐
171 tions will be output to stdout.
172
173 To successfully use the manpages feature requires the manpages to be
174 installed or on MANPATH, See man(1) for more details.
175
176 · -v, --version: Display version information for this tool, supported
177 tctis and exit.
178
179 · -V, --verbose: Increase the information that the tool prints to the
180 console during its execution. When using this option the file and
181 line number are printed.
182
183 · -Q, --quiet: Silence normal tool output to stdout.
184
185 · -Z, --enable-errata: Enable the application of errata fixups. Useful
186 if an errata fixup needs to be applied to commands sent to the TPM.
187 Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent. in‐
188 formation many users may expect.
189
191 The TCTI or "Transmission Interface" is the communication mechanism
192 with the TPM. TCTIs can be changed for communication with TPMs across
193 different mediums.
194
195 To control the TCTI, the tools respect:
196
197 1. The command line option -T or --tcti
198
199 2. The environment variable: TPM2TOOLS_TCTI.
200
201 Note: The command line option always overrides the environment vari‐
202 able.
203
204 The current known TCTIs are:
205
206 · tabrmd - The resource manager, called tabrmd
207 (https://github.com/tpm2-software/tpm2-abrmd). Note that tabrmd and
208 abrmd as a tcti name are synonymous.
209
210 · mssim - Typically used for communicating to the TPM software simula‐
211 tor.
212
213 · device - Used when talking directly to a TPM device file.
214
215 · none - Do not initalize a connection with the TPM. Some tools allow
216 for off-tpm options and thus support not using a TCTI. Tools that do
217 not support it will error when attempted to be used without a TCTI
218 connection. Does not support ANY options and MUST BE presented as
219 the exact text of "none".
220
221 The arguments to either the command line option or the environment
222 variable are in the form:
223
224 <tcti-name>:<tcti-option-config>
225
226 Specifying an empty string for either the <tcti-name> or <tcti-op‐
227 tion-config> results in the default being used for that portion respec‐
228 tively.
229
230 TCTI Defaults
231 When a TCTI is not specified, the default TCTI is searched for using
232 dlopen(3) semantics. The tools will search for tabrmd, device and
233 mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND. You can query
234 what TCTI will be chosen as the default by using the -v option to print
235 the version information. The "default-tcti" key-value pair will indi‐
236 cate which of the aforementioned TCTIs is the default.
237
238 Custom TCTIs
239 Any TCTI that implements the dynamic TCTI interface can be loaded. The
240 tools internally use dlopen(3), and the raw tcti-name value is used for
241 the lookup. Thus, this could be a path to the shared library, or a li‐
242 brary name as understood by dlopen(3) semantics.
243
245 This collection of options are used to configure the various known TCTI
246 modules available:
247
248 · device: For the device TCTI, the TPM character device file for use by
249 the device TCTI can be specified. The default is /dev/tpm0.
250
251 Example: -T device:/dev/tpm0 or export TPM2TOOLS_TCTI="de‐
252 vice:/dev/tpm0"
253
254 · mssim: For the mssim TCTI, the domain name or IP address and port
255 number used by the simulator can be specified. The default are
256 127.0.0.1 and 2321.
257
258 Example: -T mssim:host=localhost,port=2321 or export TPM2TOOLS_TC‐
259 TI="mssim:host=localhost,port=2321"
260
261 · abrmd: For the abrmd TCTI, the configuration string format is a se‐
262 ries of simple key value pairs separated by a ',' character. Each
263 key and value string are separated by a '=' character.
264
265 · TCTI abrmd supports two keys:
266
267 1. 'bus_name' : The name of the tabrmd service on the bus (a
268 string).
269
270 2. 'bus_type' : The type of the dbus instance (a string) limited to
271 'session' and 'system'.
272
273 Specify the tabrmd tcti name and a config string of bus_name=com.ex‐
274 ample.FooBar:
275
276 \--tcti=tabrmd:bus_name=com.example.FooBar
277
278 Specify the default (abrmd) tcti and a config string of bus_type=ses‐
279 sion:
280
281 \--tcti:bus_type=session
282
283 NOTE: abrmd and tabrmd are synonymous. the various known TCTI mod‐
284 ules.
285
287 Define an ordinary NV index and delete it
288 tpm2_nvdefine 1
289
290 tpm2_nvundefine 1
291
292 Define an ordinary NV index with attribute
293 TPMA_NV_POLICY_DELETE and delete it
294
295 tpm2_startauthsession -S s.ctx
296
297 tpm2_policyauthvalue -S s.ctx
298
299 tpm2_policycommandcode -S s.ctx -L policy.dat TPM2_CC_NV_UndefineSpaceSpecial
300
301 tpm2_nvdefine -C p -s 32 \
302 -a "ppread|ppwrite|authread|authwrite|platformcreate|policydelete|write_stclear|read_stclear" \
303 -L policy.dat 1
304
305 tpm2_flushcontext s.ctx
306
307 tpm2_startauthsession --policy-session -S s.ctx
308
309 tpm2_policyauthvalue -S s.ctx
310
311 tpm2_policycommandcode -S s.ctx TPM2_CC_NV_UndefineSpaceSpecial
312
313 tpm2_nvundefine -S s.ctx 1
314
316 Tools can return any of the following codes:
317
318 · 0 - Success.
319
320 · 1 - General non-specific error.
321
322 · 2 - Options handling error.
323
324 · 3 - Authentication error.
325
326 · 4 - TCTI related error.
327
328 · 5 - Non supported scheme. Applicable to tpm2_testparams.
329
331 Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
332
334 See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)
335
336
337
338tpm2-tools tpm2_nvundefine(1)