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

NAME

6       tpm2_nvreadpublic(1) - Display all defined Non-Volatile (NV)s indices.
7

SYNOPSIS

9       tpm2_nvreadpublic [OPTIONS]
10

DESCRIPTION

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

OPTIONS

47--cphash=FILE
48
49         File path to record the hash of the command parameters.  This is com‐
50         monly termed as cpHash.  NOTE: When this option is selected, The tool
51         will not actually execute the command, it simply returns a cpHash un‐
52         less rphash is also required.
53
54--rphash=FILE
55
56         File  path  to  record  the hash of the response parameters.  This is
57         commonly termed as rpHash.
58
59-S, --session=POLICY_SESSION:
60
61         Specify an auxiliary session for auditing and  or  encryption/decryp‐
62         tion of the parameters.
63
64-n, --name=FILE:
65
66         The  name of the NV index that must be provided when only calculating
67         the cpHash without actually dispatching the command to the TPM.
68

COMMON OPTIONS

70       This collection of options are common to many programs and provide  in‐
71       formation that many users may expect.
72
73-h,  --help=[man|no-man]:  Display the tools manpage.  By default, it
74         attempts to invoke the manpager for the  tool,  however,  on  failure
75         will  output  a short tool summary.  This is the same behavior if the
76         “man” option argument is specified, however if explicit “man” is  re‐
77         quested,  the  tool  will  provide errors from man on stderr.  If the
78         “no-man” option if specified, or the manpager fails,  the  short  op‐
79         tions will be output to stdout.
80
81         To  successfully use the manpages feature requires the manpages to be
82         installed or on MANPATH, See man(1) for more details.
83
84-v, --version: Display version information for this  tool,  supported
85         tctis and exit.
86
87-V,  --verbose:  Increase the information that the tool prints to the
88         console during its execution.  When using this option  the  file  and
89         line number are printed.
90
91-Q, --quiet: Silence normal tool output to stdout.
92
93-Z, --enable-errata: Enable the application of errata fixups.  Useful
94         if an errata fixup needs to be applied to commands sent to  the  TPM.
95         Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
96

TCTI Configuration

98       The  TCTI  or  “Transmission  Interface” is the communication mechanism
99       with the TPM.  TCTIs can be changed for communication with TPMs  across
100       different mediums.
101
102       To control the TCTI, the tools respect:
103
104       1. The command line option -T or --tcti
105
106       2. The environment variable: TPM2TOOLS_TCTI.
107
108       Note:  The  command  line option always overrides the environment vari‐
109       able.
110
111       The current known TCTIs are:
112
113       • tabrmd     -     The     resource     manager,     called      tabrmd
114         (https://github.com/tpm2-software/tpm2-abrmd).   Note that tabrmd and
115         abrmd as a tcti name are synonymous.
116
117       • mssim - Typically used for communicating to the TPM software  simula‐
118         tor.
119
120       • device - Used when talking directly to a TPM device file.
121
122       • none  - Do not initalize a connection with the TPM.  Some tools allow
123         for off-tpm options and thus support not using a TCTI.  Tools that do
124         not  support  it  will error when attempted to be used without a TCTI
125         connection.  Does not support ANY options and MUST  BE  presented  as
126         the exact text of “none”.
127
128       The  arguments  to  either  the  command line option or the environment
129       variable are in the form:
130
131       <tcti-name>:<tcti-option-config>
132
133       Specifying an empty string for  either  the  <tcti-name>  or  <tcti-op‐
134       tion-config> results in the default being used for that portion respec‐
135       tively.
136
137   TCTI Defaults
138       When a TCTI is not specified, the default TCTI is  searched  for  using
139       dlopen(3)  semantics.   The  tools  will  search for tabrmd, device and
140       mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND.  You  can  query
141       what TCTI will be chosen as the default by using the -v option to print
142       the version information.  The “default-tcti” key-value pair will  indi‐
143       cate which of the aforementioned TCTIs is the default.
144
145   Custom TCTIs
146       Any TCTI that implements the dynamic TCTI interface can be loaded.  The
147       tools internally use dlopen(3), and the raw tcti-name value is used for
148       the lookup.  Thus, this could be a path to the shared library, or a li‐
149       brary name as understood by dlopen(3) semantics.
150

TCTI OPTIONS

152       This collection of options are used to configure the various known TCTI
153       modules available:
154
155device: For the device TCTI, the TPM character device file for use by
156         the device TCTI can be specified.  The default is /dev/tpm0.
157
158         Example:   -T   device:/dev/tpm0   or   export    TPM2TOOLS_TCTI=“de‐
159         vice:/dev/tpm0”
160
161mssim:  For  the  mssim  TCTI, the domain name or IP address and port
162         number used by the simulator  can  be  specified.   The  default  are
163         127.0.0.1 and 2321.
164
165         Example:  -T  mssim:host=localhost,port=2321  or export TPM2TOOLS_TC‐
166         TI=“mssim:host=localhost,port=2321”
167
168abrmd: For the abrmd TCTI, the configuration string format is  a  se‐
169         ries  of  simple  key value pairs separated by a `,' character.  Each
170         key and value string are separated by a `=' character.
171
172         • TCTI abrmd supports two keys:
173
174           1. `bus_name' : The name of  the  tabrmd  service  on  the  bus  (a
175              string).
176
177           2. `bus_type' : The type of the dbus instance (a string) limited to
178              `session' and `system'.
179
180         Specify the tabrmd tcti name and a config string of  bus_name=com.ex‐
181         ample.FooBar:
182
183                \--tcti=tabrmd:bus_name=com.example.FooBar
184
185         Specify the default (abrmd) tcti and a config string of bus_type=ses‐
186         sion:
187
188                \--tcti:bus_type=session
189
190         NOTE: abrmd and tabrmd are synonymous.
191

NV Attributes

193       NV Attributes are used to control various properties of the NV  defined
194       space.   When  specified  as an option, either the raw bitfield mask or
195       “nice-names” may be used.  The values can be found in Table 204 Part  2
196       of the TPM2.0 specification, which can be found here:
197
198       <https://trustedcomputinggroup.org/wp-content/uploads/TPM-
199       Rev-2.0-Part-2-Structures-01.38.pdf>
200
201       Nice names are calculated by taking the name field of table 204 and re‐
202       moving  the  prefix  TPMA_NV_  and  lowercasing  the result.  Thus, TP‐
203       MA_NV_PPWRITE becomes ppwrite.  Nice names can be joined using the bit‐
204       wise or “|” symbol.
205
206       Note  that the TPM_NT field is 4 bits wide, and thus can be set via nt=
207       format.   For  instance,  to  set  The  fields  TPMA_NV_OWNERREAD,  TP‐
208       MA_NV_OWNERWRITE,  TPMA_NV_POLICYWRITE, and TPMA_NT = 0x2, the argument
209       would be:
210
211       ownerread|ownerwrite|policywrite|nt=0x2
212
213       Additionally, the NT field, which denotes the type of the NV index, can
214       also  be  specified  via friendly names: * ordinary - Ordinary contains
215       data that is opaque  to  the  TPM  that  can  only  be  modified  using
216       TPM2_NV_Write.   *  extend  - Extend is used similarly to a PCR and can
217       only be modified with TPM2_NV_Extend.  Its size is  determined  by  the
218       length  of  the  hash  algorithm used.  * counter - Counter contains an
219       8-octet value that is to be used as a counter and can only be  modified
220       with  TPM2_NV_Increment * bits - Bit Field contains an 8-octet value to
221       be used as a bit field and can only be modified  with  TPM2_NV_SetBits.
222       *  pinfail - PIN Fail contains an 8-octet pinCount that increments on a
223       PIN authorization failure and a pinLimit.  * pinpass -  PIN  Pass  con‐
224       tains  an  8-octet pinCount that increments on a PIN authorization suc‐
225       cess and a pinLimit.
226
227       For instance, to set The fields TPMA_NV_OWNERREAD,  TPMA_NV_OWNERWRITE,
228       TPMA_NV_POLICYWRITE, and TPMA_NT = bits, the argument would be:
229
230       ownerread|ownerwrite|policywrite|nt=bits
231

EXAMPLES

233   List the defined NV indices to stdout
234              tpm2_nvreadpublic
235

Returns

237       Tools can return any of the following codes:
238
239       • 0 - Success.
240
241       • 1 - General non-specific error.
242
243       • 2 - Options handling error.
244
245       • 3 - Authentication error.
246
247       • 4 - TCTI related error.
248
249       • 5 - Non supported scheme.  Applicable to tpm2_testparams.
250

BUGS

252       Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
253

HELP

255       See the Mailing List (https://lists.linuxfoundation.org/mailman/listin
256       fo/tpm2)
257
258
259
260tpm2-tools                                                tpm2_nvreadpublic(1)
Impressum