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

NAME

6       tpm2_nvdefine(1) - define a TPM Non-Volatile (NV) index.
7

SYNOPSIS

9       tpm2_nvdefine [OPTIONS]
10

DESCRIPTION

12       tpm2_nvdefine(1) - Define NV index with given auth value.
13

OPTIONS

15       · -x, –index=NV_INDEX: Specifies the index to define the space at.
16
17       · -a,  –auth-handle=SECRET_DATA_FILE:  specifies the handle used to au‐
18         thorize:
19
20         · 0x40000001 for TPM_RH_OWNER
21
22         · 0x4000000C for TPM_RH_PLATFORM
23
24       · -s, –size=SIZE: specifies the size of data area in  bytes.   Defaults
25         to MAX_NV_INDEX_SIZE which is typically 2048.
26
27       · -t,  –attributes=ATTRIBUTES Specifies the attribute values for the nv
28         region used when creating the entitiy.  Either the raw bitfield  mask
29         or  “nice-names”  may  be used.  See section “NV Attributes” for more
30         details.
31
32       · -P, –handle-passwd=HANDLE_PASSWORD: specifies the password  of  auth‐
33         Handle.   Passwords should follow the “password formatting standards,
34         see section”Password Formatting“.
35
36       · -I, –index-passwd=INDEX_PASSWORD: specifies the password of NV  Index
37         when  created.   Follows the same formatting guidelines as the handle
38         password or -P option.
39
40       · -L, –policy-file=POLICY_FILE: Specifies the policy  digest  file  for
41         policy based authorizations.
42
43       · -S,  –input-session-handle=SIZE: Optional Input session handle from a
44         policy session for authorization.
45

COMMON OPTIONS

47       This collection of options are common to many programs and provide  in‐
48       formation that many users may expect.
49
50       · -h,  –help: Display the tools manpage.  This requires the manpages to
51         be installed or on MANPATH, See man(1) for more details.
52
53       · -v, –version: Display version information for  this  tool,  supported
54         tctis and exit.
55
56       · -V,  –verbose:  Increase  the information that the tool prints to the
57         console during its execution.  When using this option  the  file  and
58         line number are printed.
59
60       · -Q, –quiet: Silence normal tool output to stdout.
61
62       · -Z,  –enable-errata: Enable the application of errata fixups.  Useful
63         if an errata fixup needs to be applied to commands sent to  the  TPM.
64         # TCTI ENVIRONMENT
65
66       This  collection of environment variables that may be used to configure
67       the various TCTI modules available.
68
69       The values passed through  these  variables  can  be  overridden  on  a
70       per-command basis using the available command line options, see the TC‐
71       TI_OPTIONS section.
72
73       The variables respected depend on how the software was configured.
74
75       · TPM2TOOLS_TCTI_NAME: Select the TCTI used for communication with  the
76         next  component down the TSS stack.  In most configurations this will
77         be the TPM but it could be a simulator or proxy.  The  current  known
78         TCTIs are:
79
80         · tabrmd    -    The    new    resource    manager,   called   tabrmd
81           (https://github.com/01org/tpm2-abrmd).
82
83         · socket - Typically used with the old resource manager,  or  talking
84           directly to a simulator.
85
86         · device - Used when talking directly to a TPM device file.
87
88       · TPM2TOOLS_DEVICE_FILE:  When  using  the device TCTI, specify the TPM
89         device file.  The default is “/dev/tpm0”.
90
91         Note: Using the tpm directly requires the users to ensure  that  con‐
92         current access does not occur and that they manage the tpm resources.
93         These tasks are usually managed by a resource  manager.   Linux  4.12
94         and  greater  supports an in kernel resource manager at “/dev/tpmrm”,
95         typically “/dev/tpmrm0”.
96
97       · TPM2TOOLS_SOCKET_ADDRESS: When using the socket TCTI, specify the do‐
98         main name or IP address used.  The default is 127.0.0.1.
99
100       · TPM2TOOLS_SOCKET_PORT:  When  using the socket TCTI, specify the port
101         number used.  The default is 2321.
102

TCTI OPTIONS

104       This collection of options are used to configure the varous  TCTI  mod‐
105       ules available.  They override any environment variables.
106
107       · -T, –tcti=TCTI_NAME[:TCTI_OPTIONS]: Select the TCTI used for communi‐
108         cation with the next component down the TSS stack.  In most  configu‐
109         rations    this    will    be    the    resource    manager:   tabrmd
110         (https://github.com/01org/tpm2-abrmd) Optionally, tcti  specific  op‐
111         tions can appended to TCTI_NAME by appending a : to TCTI_NAME.
112
113         · For the device TCTI, the TPM device file for use by the device TCTI
114           can be specified.  The  default  is  /dev/tpm0.   Example:  -T  de‐
115           vice:/dev/tpm0
116
117         · For  the socket TCTI, the domain name or IP address and port number
118           used by the socket can be specified.  The default are 127.0.0.1 and
119           2321.  Example: -T socket:127.0.0.1:2321
120
121         · For the abrmd TCTI, it takes no options.  Example: -T abrmd
122

NV Attributes

124       NV  Attributes are used to control various properties of the NV defined
125       space.  When specified as an option, either the raw  bitfield  mask  or
126       “nice-names”  may be used.  The values can be found in Table 204 Part 2
127       of the TPM2.0 specification, which can be found here:
128
129       <https://trustedcomputinggroup.org/wp-content/uploads/TPM-
130       Rev-2.0-Part-2-Structures-01.38.pdf>
131
132       Nice names are calculated by taking the name field of table 204 and re‐
133       moving the prefix TPMA_NV_  and  lowercasing  the  result.   Thus,  TP‐
134       MA_NV_PPWRITE becomes ppwrite.  Nice names can be joined using the bit‐
135       wise or “|” symbol.
136
137       Note that the TPM_NT field is 4 bits wide, and thus can be set via  nt=
138       format.   For  instance,  to  set  The  fields  TPMA_NV_OWNERREAD,  TP‐
139       MA_NV_OWNERWRITE, TPMA_NV_POLICYWRITE, and TPMA_NT = 0x3, the  argument
140       would be:
141
142       ownerread|ownerwrite|policywrite|nt=0x3 # Password Formatting
143
144       Passwords  are  interpreted  in  two  forms,  string and hex-string.  A
145       string password is not interpreted, and is directly used for authoriza‐
146       tion.   A  hex-string, is converted from a hexidecimal form into a byte
147       array form, thus allowing passwords with non-printable and/or  terminal
148       un-friendly characters.
149
150       By  default  passwords  are assumed to be in the string form.  Password
151       form is specified with special prefix values, they are:
152
153       · str: - Used to indicate it is a raw string.  Useful  for  escaping  a
154         password that starts with the “hex:” prefix.
155
156       · hex: - Used when specifying a password in hex string format.
157

EXAMPLES

159              tpm2_nvdefine -x 0x1500016 -a 0x40000001 -s 32 -t 0x2000A
160              tpm2_nvdefine -x 0x1500016 -a 0x40000001 -s 32 -t ownerread|ownerwrite|policywrite -I 1a1b1c
161

RETURNS

163       0 on success or 1 on failure.
164

BUGS

166       Github Issues (https://github.com/01org/tpm2-tools/issues)
167

HELP

169       See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)
170
171
172
173tpm2-tools                      SEPTEMBER 2017                tpm2_nvdefine(1)
Impressum