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

NAME

6       tpm2_hierarchycontrol(1)  -  Enable  and disable use of a hierarchy and
7       its associated NV storage.
8

SYNOPSIS

10       tpm2_hierarchycontrol [OPTIONS] VARIABLE OPERATION
11

DESCRIPTION

13       tpm2_hierarchycontrol(1) - Allows  user  change  phEnable,  phEnableNV,
14       shEnable  and  ehEnable when the proper authorization is provided.  Au‐
15       thorization should be one out of owner hierarchy auth, endorsement  hi‐
16       erarchy  auth  and  platform  hierarchy  auth.  As an argument the tool
17       takes the VARIABLE as TPMA_STARTUP_CLEAR bit and _OPERATION_ as  string
18       clear|set to clear or set the VARIABLE bit.
19
20       Note: If password option is missing, assume NULL.
21

OPTIONS

23-C, --hierarchy=OBJECT:
24         Specifies  the  handle used to authorize.  Defaults to the “platform”
25         hierarchy.  Supported options are:
26
27o for TPM_RH_OWNER
28
29p for TPM_RH_PLATFORM
30
31<num> where a raw number can be used.
32
33-P, --hierarchy-auth=AUTH:
34
35         Specifies the authorization value for the hierarchy.
36
37--cphash=FILE
38
39         File path to record the hash of the command parameters.  This is com‐
40         monly termed as cpHash.  NOTE: When this option is selected, The tool
41         will not actually execute the command, it simply returns a cpHash.
42
43   References

Context Object Format

45       The type of a context object, whether it is a handle or file  name,  is
46       determined according to the following logic in-order:
47
48       • If the argument is a file path, then the file is loaded as a restored
49         TPM transient object.
50
51       • If the argument is a prefix match on one of:
52
53         • owner: the owner hierarchy
54
55         • platform: the platform hierarchy
56
57         • endorsement: the endorsement hierarchy
58
59         • lockout: the lockout control persistent object
60
61       • If the argument argument can be loaded as a number it will  be  treat
62         as a handle, e.g. 0x81010013 and used directly._OBJECT_.
63

Authorization Formatting

65       Authorization  for  use  of an object in TPM2.0 can come in 3 different
66       forms: 1.  Password 2.  HMAC 3.  Sessions
67
68       NOTE: “Authorizations default to the EMPTY  PASSWORD  when  not  speci‐
69       fied”.
70
71   Passwords
72       Passwords  are  interpreted  in  the following forms below using prefix
73       identifiers.
74
75       Note: By default passwords are assumed to be in the  string  form  when
76       they do not have a prefix.
77
78   String
79       A  string  password,  specified  by  prefix “str:” or it’s absence (raw
80       string without prefix) is not interpreted, and is directly used for au‐
81       thorization.
82
83   Examples
84              foobar
85              str:foobar
86
87   Hex-string
88       A  hex-string  password, specified by prefix “hex:” is converted from a
89       hexidecimal form into a byte array form, thus allowing  passwords  with
90       non-printable and/or terminal un-friendly characters.
91
92   Example
93              hex:1122334455667788
94
95   File
96       A  file  based password, specified be prefix “file:” should be the path
97       of a file containing the password to be read by the tool or  a  “-”  to
98       use  stdin.   Storing  passwords in files prevents information leakage,
99       passwords passed as options can be read from the process list or common
100       shell history features.
101
102   Examples
103              # to use stdin and be prompted
104              file:-
105
106              # to use a file from a path
107              file:path/to/password/file
108
109              # to echo a password via stdin:
110              echo foobar | tpm2_tool -p file:-
111
112              # to use a bash here-string via stdin:
113
114              tpm2_tool -p file:- <<< foobar
115
116   Sessions
117       When  using  a policy session to authorize the use of an object, prefix
118       the option argument with the session keyword.  Then indicate a path  to
119       a session file that was created with tpm2_startauthsession(1).  Option‐
120       ally, if the session requires an auth value to be sent with the session
121       handle  (eg policy password), then append a + and a string as described
122       in the Passwords section.
123
124   Examples
125       To use a session context file called session.ctx.
126
127              session:session.ctx
128
129       To use a session context file called session.ctx AND send the authvalue
130       mypassword.
131
132              session:session.ctx+mypassword
133
134       To use a session context file called session.ctx AND send the HEX auth‐
135       value 0x11223344.
136
137              session:session.ctx+hex:11223344
138
139   PCR Authorizations
140       You can satisfy a PCR policy using the “pcr:” prefix and the PCR  mini‐
141       language.       The     PCR     minilanguage     is     as     follows:
142       <pcr-spec>=<raw-pcr-file>
143
144       The PCR spec is documented in in the section “PCR bank specifiers”.
145
146       The raw-pcr-file is an optional argument that contains  the  output  of
147       the raw PCR contents as returned by tpm2_pcrread(1).
148
149       PCR bank specifiers (pcr.md)
150
151   Examples
152       To satisfy a PCR policy of sha256 on banks 0, 1, 2 and 3 use a specifi‐
153       er of:
154
155              pcr:sha256:0,1,2,3
156
157       specifying AUTH.
158

COMMON OPTIONS

160       This collection of options are common to many programs and provide  in‐
161       formation that many users may expect.
162
163-h,  --help=[man|no-man]:  Display the tools manpage.  By default, it
164         attempts to invoke the manpager for the  tool,  however,  on  failure
165         will  output  a short tool summary.  This is the same behavior if the
166         “man” option argument is specified, however if explicit “man” is  re‐
167         quested,  the  tool  will  provide errors from man on stderr.  If the
168         “no-man” option if specified, or the manpager fails,  the  short  op‐
169         tions will be output to stdout.
170
171         To  successfully use the manpages feature requires the manpages to be
172         installed or on MANPATH, See man(1) for more details.
173
174-v, --version: Display version information for this  tool,  supported
175         tctis and exit.
176
177-V,  --verbose:  Increase the information that the tool prints to the
178         console during its execution.  When using this option  the  file  and
179         line number are printed.
180
181-Q, --quiet: Silence normal tool output to stdout.
182
183-Z, --enable-errata: Enable the application of errata fixups.  Useful
184         if an errata fixup needs to be applied to commands sent to  the  TPM.
185         Defining  the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.  in‐
186         formation many users may expect.
187

TCTI Configuration

189       The TCTI or “Transmission Interface”  is  the  communication  mechanism
190       with  the TPM.  TCTIs can be changed for communication with TPMs across
191       different mediums.
192
193       To control the TCTI, the tools respect:
194
195       1. The command line option -T or --tcti
196
197       2. The environment variable: TPM2TOOLS_TCTI.
198
199       Note: The command line option always overrides  the  environment  vari‐
200       able.
201
202       The current known TCTIs are:
203
204       • tabrmd      -     The     resource     manager,     called     tabrmd
205         (https://github.com/tpm2-software/tpm2-abrmd).  Note that tabrmd  and
206         abrmd as a tcti name are synonymous.
207
208       • mssim  - Typically used for communicating to the TPM software simula‐
209         tor.
210
211       • device - Used when talking directly to a TPM device file.
212
213       • none - Do not initalize a connection with the TPM.  Some tools  allow
214         for off-tpm options and thus support not using a TCTI.  Tools that do
215         not support it will error when attempted to be used  without  a  TCTI
216         connection.   Does  not  support ANY options and MUST BE presented as
217         the exact text of “none”.
218
219       The arguments to either the command  line  option  or  the  environment
220       variable are in the form:
221
222       <tcti-name>:<tcti-option-config>
223
224       Specifying  an  empty  string  for  either the <tcti-name> or <tcti-op‐
225       tion-config> results in the default being used for that portion respec‐
226       tively.
227
228   TCTI Defaults
229       When  a  TCTI  is not specified, the default TCTI is searched for using
230       dlopen(3) semantics.  The tools will  search  for  tabrmd,  device  and
231       mssim  TCTIs  IN THAT ORDER and USE THE FIRST ONE FOUND.  You can query
232       what TCTI will be chosen as the default by using the -v option to print
233       the  version information.  The “default-tcti” key-value pair will indi‐
234       cate which of the aforementioned TCTIs is the default.
235
236   Custom TCTIs
237       Any TCTI that implements the dynamic TCTI interface can be loaded.  The
238       tools internally use dlopen(3), and the raw tcti-name value is used for
239       the lookup.  Thus, this could be a path to the shared library, or a li‐
240       brary name as understood by dlopen(3) semantics.
241

TCTI OPTIONS

243       This collection of options are used to configure the various known TCTI
244       modules available:
245
246device: For the device TCTI, the TPM character device file for use by
247         the device TCTI can be specified.  The default is /dev/tpm0.
248
249         Example:    -T   device:/dev/tpm0   or   export   TPM2TOOLS_TCTI=“de‐
250         vice:/dev/tpm0”
251
252mssim: For the mssim TCTI, the domain name or  IP  address  and  port
253         number  used  by  the  simulator  can  be specified.  The default are
254         127.0.0.1 and 2321.
255
256         Example: -T mssim:host=localhost,port=2321  or  export  TPM2TOOLS_TC‐
257         TI=“mssim:host=localhost,port=2321”
258
259abrmd:  For  the abrmd TCTI, the configuration string format is a se‐
260         ries of simple key value pairs separated by a  `,'  character.   Each
261         key and value string are separated by a `=' character.
262
263         • TCTI abrmd supports two keys:
264
265           1. `bus_name'  :  The  name  of  the  tabrmd  service on the bus (a
266              string).
267
268           2. `bus_type' : The type of the dbus instance (a string) limited to
269              `session' and `system'.
270
271         Specify  the tabrmd tcti name and a config string of bus_name=com.ex‐
272         ample.FooBar:
273
274                \--tcti=tabrmd:bus_name=com.example.FooBar
275
276         Specify the default (abrmd) tcti and a config string of bus_type=ses‐
277         sion:
278
279                \--tcti:bus_type=session
280
281         NOTE:  abrmd  and tabrmd are synonymous.  the various known TCTI mod‐
282         ules.
283

EXAMPLES

285   Set phEnableNV with platform hierarchy and its authorization
286              tpm2_hierarchycontrol -C p phEnableNV set -P pass
287
288   clear phEnableNV with platform hierarchy
289              tpm2_hierarchycontrol -C p phEnableNV clear
290
291   Set shEnable with platform hierarchy
292              tpm2_hierarchycontrol -C p shEnable set
293
294   Set shEnable with owner hierarchy
295              tpm2_hierarchycontrol -C o shEnable set
296
297   Check current TPMA_STARTUP_CLEAR Bits
298              tpm2_getcap properties-variable
299

Returns

301       Tools can return any of the following codes:
302
303       • 0 - Success.
304
305       • 1 - General non-specific error.
306
307       • 2 - Options handling error.
308
309       • 3 - Authentication error.
310
311       • 4 - TCTI related error.
312
313       • 5 - Non supported scheme.  Applicable to tpm2_testparams.
314

BUGS

316       Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
317

HELP

319       See the Mailing List (https://lists.linuxfoundation.org/mailman/listin
320       fo/tpm2)
321
322
323
324tpm2-tools                         July 2019          tpm2_hierarchycontrol(1)
Impressum