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

NAME

6       tpm2_policyrestart(1) - Restart an existing session with the TPM.
7

SYNOPSIS

9       tpm2_policyrestart [OPTIONS]
10

DESCRIPTION

12       tpm2_policyrestart(1)  -  Restarts  a session with the TPM back to it's
13       initial  state.   This  is  useful   when   the   TPM   gives   one   a
14       TPM_RC_PCR_CHANGED (0x00000128) error code when using a PCR policy ses‐
15       sion.
16
17       This will be returned if a PCR state affecting policy is altered during
18       the session.  One could restart the session and try again, however, the
19       PCR state would still need to satisfy the policy.
20

OPTIONS

22       · -S, --session=FILE:
23
24         Optional, A session file from tpm2_startauthsession(1)'s  -S  option.
25         This  session is used in lieu of starting a session and using the PCR
26         policy options.
27
28   References

COMMON OPTIONS

30       This collection of options are common to many programs and provide  in‐
31       formation that many users may expect.
32
33       · -h,  --help=[man|no-man]:  Display the tools manpage.  By default, it
34         attempts to invoke the manpager for the  tool,  however,  on  failure
35         will  output  a short tool summary.  This is the same behavior if the
36         "man" option argument is specified, however if explicit "man" is  re‐
37         quested,  the  tool  will  provide errors from man on stderr.  If the
38         "no-man" option if specified, or the manpager fails,  the  short  op‐
39         tions will be output to stdout.
40
41         To  successfully use the manpages feature requires the manpages to be
42         installed or on MANPATH, See man(1) for more details.
43
44       · -v, --version: Display version information for this  tool,  supported
45         tctis and exit.
46
47       · -V,  --verbose:  Increase the information that the tool prints to the
48         console during its execution.  When using this option  the  file  and
49         line number are printed.
50
51       · -Q, --quiet: Silence normal tool output to stdout.
52
53       · -Z, --enable-errata: Enable the application of errata fixups.  Useful
54         if an errata fixup needs to be applied to commands sent to  the  TPM.
55         Defining  the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.  in‐
56         formation many users may expect.
57

TCTI Configuration

59       The TCTI or "Transmission Interface"  is  the  communication  mechanism
60       with  the TPM.  TCTIs can be changed for communication with TPMs across
61       different mediums.
62
63       To control the TCTI, the tools respect:
64
65       1. The command line option -T or --tcti
66
67       2. The environment variable: TPM2TOOLS_TCTI.
68
69       Note: The command line option always overrides  the  environment  vari‐
70       able.
71
72       The current known TCTIs are:
73
74       · tabrmd      -     The     resource     manager,     called     tabrmd
75         (https://github.com/tpm2-software/tpm2-abrmd).  Note that tabrmd  and
76         abrmd as a tcti name are synonymous.
77
78       · mssim  - Typically used for communicating to the TPM software simula‐
79         tor.
80
81       · device - Used when talking directly to a TPM device file.
82
83       · none - Do not initalize a connection with the TPM.  Some tools  allow
84         for off-tpm options and thus support not using a TCTI.  Tools that do
85         not support it will error when attempted to be used  without  a  TCTI
86         connection.   Does  not  support ANY options and MUST BE presented as
87         the exact text of "none".
88
89       The arguments to either the command  line  option  or  the  environment
90       variable are in the form:
91
92       <tcti-name>:<tcti-option-config>
93
94       Specifying  an  empty  string  for  either the <tcti-name> or <tcti-op‐
95       tion-config> results in the default being used for that portion respec‐
96       tively.
97
98   TCTI Defaults
99       When  a  TCTI  is not specified, the default TCTI is searched for using
100       dlopen(3) semantics.  The tools will  search  for  tabrmd,  device  and
101       mssim  TCTIs  IN THAT ORDER and USE THE FIRST ONE FOUND.  You can query
102       what TCTI will be chosen as the default by using the -v option to print
103       the  version information.  The "default-tcti" key-value pair will indi‐
104       cate which of the aforementioned TCTIs is the default.
105
106   Custom TCTIs
107       Any TCTI that implements the dynamic TCTI interface can be loaded.  The
108       tools internally use dlopen(3), and the raw tcti-name value is used for
109       the lookup.  Thus, this could be a path to the shared library, or a li‐
110       brary name as understood by dlopen(3) semantics.
111

TCTI OPTIONS

113       This collection of options are used to configure the various known TCTI
114       modules available:
115
116       · device: For the device TCTI, the TPM character device file for use by
117         the device TCTI can be specified.  The default is /dev/tpm0.
118
119         Example:    -T   device:/dev/tpm0   or   export   TPM2TOOLS_TCTI="de‐
120         vice:/dev/tpm0"
121
122       · mssim: For the mssim TCTI, the domain name or  IP  address  and  port
123         number  used  by  the  simulator  can  be specified.  The default are
124         127.0.0.1 and 2321.
125
126         Example: -T mssim:host=localhost,port=2321  or  export  TPM2TOOLS_TC‐
127         TI="mssim:host=localhost,port=2321"
128
129       · abrmd:  For  the abrmd TCTI, the configuration string format is a se‐
130         ries of simple key value pairs separated by a  ','  character.   Each
131         key and value string are separated by a '=' character.
132
133         · TCTI abrmd supports two keys:
134
135           1. 'bus_name'  :  The  name  of  the  tabrmd  service on the bus (a
136              string).
137
138           2. 'bus_type' : The type of the dbus instance (a string) limited to
139              'session' and 'system'.
140
141         Specify  the tabrmd tcti name and a config string of bus_name=com.ex‐
142         ample.FooBar:
143
144         \--tcti=tabrmd:bus_name=com.example.FooBar
145
146         Specify the default (abrmd) tcti and a config string of bus_type=ses‐
147         sion:
148
149         \--tcti:bus_type=session
150
151         NOTE:  abrmd  and tabrmd are synonymous.  the various known TCTI mod‐
152         ules.
153

EXAMPLES

155   Start a policy session and restart it, unsealing some data.
156              # create a policy and bind it to an object
157              tpm2_startauthsession -S session.dat
158
159              tpm2_policypcr -S session.dat -l "sha1:0,1,2,3" -L policy.dat
160
161              tpm2_createprimary -c primary.ctx
162
163              tpm2_create -Cprimary.ctx -u key.pub -r key.priv -L policy.dat -i- <<< "secret"
164
165              tpm2_load -C primary.ctx -c key.ctx -u key.pub -r key.priv
166
167              tpm2_flushcontext session.dat
168
169              # satisfy the policy and use the object
170              tpm2_startauthsession --policy -S session.dat
171
172              tpm2_policypcr -S session.dat -l "sha1:0,1,2,3"
173
174              # PCR event occurs here causing unseal to fail
175              tpm2_pcrevent 0 <<< "event data"
176
177              tpm2_unseal -psession:session.dat -c key.ct
178              ERROR: Esys_Unseal(0x128) - tpm:error(2.0): PCR have changed since checked
179
180              # Clear the policy digest to initial state, note access to object no longer allowed by
181              # policy so policyor would be useful here.
182              tpm2_policyrestart -S session.dat
183

Returns

185       Tools can return any of the following codes:
186
187       · 0 - Success.
188
189       · 1 - General non-specific error.
190
191       · 2 - Options handling error.
192
193       · 3 - Authentication error.
194
195       · 4 - TCTI related error.
196
197       · 5 - Non supported scheme.  Applicable to tpm2_testparams.
198

Limitations

200       It expects a session to be already established  via  tpm2_startauthses‐
201       sion(1) and requires one of the following:
202
203       · direct device access
204
205       · extended session support with tpm2-abrmd.
206
207       Without  it, most resource managers will not save session state between
208       command invocations.
209

BUGS

211       Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
212

HELP

214       See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)
215
216
217
218tpm2-tools                                               tpm2_policyrestart(1)
Impressum