1tpm2_policyauthvalue(1) General Commands Manual tpm2_policyauthvalue(1)
2
3
4
6 tpm2_policyauthvalue(1) - Enables binding a policy to the authorization
7 value of the authorized TPM object.
8
10 tpm2_policyauthvalue [OPTIONS]
11
13 tpm2_policyauthvalue(1) - Enables a policy that requires the object’s
14 authentication passphrase be provided. This is equivalent to authenti‐
15 cating using the object passphrase in plaintext or HMAC. It enforces
16 it as a policy. It provides a mechanism to allow for password authen‐
17 tication when an object only allows policy based authorization, ie ob‐
18 ject attribute “userwithauth” is 0.
19
21 • -L, --policy=FILE:
22
23 File to save the compounded policy digest.
24
25 • -S, --session=FILE:
26
27 The policy session file generated via the -S option to tpm2_star‐
28 tauthsession(1).
29
30 • --cphash=FILE
31
32 File path to record the hash of the command parameters. This is com‐
33 monly termed as cpHash. NOTE: When this option is selected, The tool
34 will not actually execute the command, it simply returns a cpHash.
35
36 References
38 This collection of options are common to many programs and provide in‐
39 formation that many users may expect.
40
41 • -h, --help=[man|no-man]: Display the tools manpage. By default, it
42 attempts to invoke the manpager for the tool, however, on failure
43 will output a short tool summary. This is the same behavior if the
44 “man” option argument is specified, however if explicit “man” is re‐
45 quested, the tool will provide errors from man on stderr. If the
46 “no-man” option if specified, or the manpager fails, the short op‐
47 tions will be output to stdout.
48
49 To successfully use the manpages feature requires the manpages to be
50 installed or on MANPATH, See man(1) for more details.
51
52 • -v, --version: Display version information for this tool, supported
53 tctis and exit.
54
55 • -V, --verbose: Increase the information that the tool prints to the
56 console during its execution. When using this option the file and
57 line number are printed.
58
59 • -Q, --quiet: Silence normal tool output to stdout.
60
61 • -Z, --enable-errata: Enable the application of errata fixups. Useful
62 if an errata fixup needs to be applied to commands sent to the TPM.
63 Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent. in‐
64 formation many users may expect.
65
67 The TCTI or “Transmission Interface” is the communication mechanism
68 with the TPM. TCTIs can be changed for communication with TPMs across
69 different mediums.
70
71 To control the TCTI, the tools respect:
72
73 1. The command line option -T or --tcti
74
75 2. The environment variable: TPM2TOOLS_TCTI.
76
77 Note: The command line option always overrides the environment vari‐
78 able.
79
80 The current known TCTIs are:
81
82 • tabrmd - The resource manager, called tabrmd
83 (https://github.com/tpm2-software/tpm2-abrmd). Note that tabrmd and
84 abrmd as a tcti name are synonymous.
85
86 • mssim - Typically used for communicating to the TPM software simula‐
87 tor.
88
89 • device - Used when talking directly to a TPM device file.
90
91 • none - Do not initalize a connection with the TPM. Some tools allow
92 for off-tpm options and thus support not using a TCTI. Tools that do
93 not support it will error when attempted to be used without a TCTI
94 connection. Does not support ANY options and MUST BE presented as
95 the exact text of “none”.
96
97 The arguments to either the command line option or the environment
98 variable are in the form:
99
100 <tcti-name>:<tcti-option-config>
101
102 Specifying an empty string for either the <tcti-name> or <tcti-op‐
103 tion-config> results in the default being used for that portion respec‐
104 tively.
105
106 TCTI Defaults
107 When a TCTI is not specified, the default TCTI is searched for using
108 dlopen(3) semantics. The tools will search for tabrmd, device and
109 mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND. You can query
110 what TCTI will be chosen as the default by using the -v option to print
111 the version information. The “default-tcti” key-value pair will indi‐
112 cate which of the aforementioned TCTIs is the default.
113
114 Custom TCTIs
115 Any TCTI that implements the dynamic TCTI interface can be loaded. The
116 tools internally use dlopen(3), and the raw tcti-name value is used for
117 the lookup. Thus, this could be a path to the shared library, or a li‐
118 brary name as understood by dlopen(3) semantics.
119
121 This collection of options are used to configure the various known TCTI
122 modules available:
123
124 • device: For the device TCTI, the TPM character device file for use by
125 the device TCTI can be specified. The default is /dev/tpm0.
126
127 Example: -T device:/dev/tpm0 or export TPM2TOOLS_TCTI=“de‐
128 vice:/dev/tpm0”
129
130 • mssim: For the mssim TCTI, the domain name or IP address and port
131 number used by the simulator can be specified. The default are
132 127.0.0.1 and 2321.
133
134 Example: -T mssim:host=localhost,port=2321 or export TPM2TOOLS_TC‐
135 TI=“mssim:host=localhost,port=2321”
136
137 • abrmd: For the abrmd TCTI, the configuration string format is a se‐
138 ries of simple key value pairs separated by a `,' character. Each
139 key and value string are separated by a `=' character.
140
141 • TCTI abrmd supports two keys:
142
143 1. `bus_name' : The name of the tabrmd service on the bus (a
144 string).
145
146 2. `bus_type' : The type of the dbus instance (a string) limited to
147 `session' and `system'.
148
149 Specify the tabrmd tcti name and a config string of bus_name=com.ex‐
150 ample.FooBar:
151
152 \--tcti=tabrmd:bus_name=com.example.FooBar
153
154 Specify the default (abrmd) tcti and a config string of bus_type=ses‐
155 sion:
156
157 \--tcti:bus_type=session
158
159 NOTE: abrmd and tabrmd are synonymous. the various known TCTI mod‐
160 ules.
161
163 We want to authenticate using the TPM objects plaintext authentication
164 value. While we could authenticate with an ephemeral password session,
165 in this example we will authenticate with the plaintext passphrase in a
166 policy session instead using the tpm2_policyauthvalue(1) tool.
167
168 Create the password policy
169 tpm2_startauthsession -S session.dat
170
171 tpm2_policyauthvalue -S session.dat -L policy.dat
172
173 tpm2_flushcontext session.dat
174
175 Create the object with a passphrase and the password policy
176 tpm2_createprimary -C o -c prim.ctx
177
178 tpm2_create -g sha256 -G aes -u key.pub -r key.priv -C prim.ctx -L policy.dat \
179 -p testpswd
180
181 Authenticate with plaintext passphrase input
182 tpm2_load -C prim.ctx -u key.pub -r key.priv -n key.name -c key.ctx
183
184 echo "plaintext" > plain.txt
185 tpm2_encryptdecrypt -c key.ctx -o encrypt.out plain.txt -p testpswd
186
187 Authenticate with password and the policy
188 tpm2_startauthsession --policy-session -S session.dat
189
190 tpm2_policyauthvalue -S session.dat
191
192 tpm2_encryptdecrypt -c key.ctx -o encrypt.out -p session:session.dat+testpswd \
193 plain.txt
194
195 tpm2_flushcontext session.dat
196
198 Tools can return any of the following codes:
199
200 • 0 - Success.
201
202 • 1 - General non-specific error.
203
204 • 2 - Options handling error.
205
206 • 3 - Authentication error.
207
208 • 4 - TCTI related error.
209
210 • 5 - Non supported scheme. Applicable to tpm2_testparams.
211
213 It expects a session to be already established via tpm2_startauthses‐
214 sion(1) and requires one of the following:
215
216 • direct device access
217
218 • extended session support with tpm2-abrmd.
219
220 Without it, most resource managers will not save session state between
221 command invocations.
222
224 Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
225
227 See the Mailing List (https://lists.linuxfoundation.org/mailman/listin‐
228 fo/tpm2)
229
230
231
232tpm2-tools tpm2_policyauthvalue(1)