tpm2_policyrestart.1 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_policyrestart" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_policyrestart\f[](1) \- Restart an existing session with the
  8. TPM.
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]tpm2_policyrestart\f[] [\f[I]OPTIONS\f[]]
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]tpm2_policyrestart\f[](1) \- Restarts a session with the TPM back
  15. to it\[aq]s initial state.
  16. This is useful when the TPM gives one a \f[B]TPM_RC_PCR_CHANGED\f[]
  17. (\f[C]0x00000128\f[]) error code when using a PCR policy session.
  18. .PP
  19. This will be returned if a PCR state affecting policy is altered during
  20. the session.
  21. One could restart the session and try again, however, the PCR state
  22. would still need to satisfy the policy.
  23. .SH OPTIONS
  24. .IP \[bu] 2
  25. \f[B]\-S\f[], \f[B]\-\-session\f[]=\f[I]FILE\f[]:
  26. .RS 2
  27. .PP
  28. Optional, A session file from \f[B]tpm2_startauthsession\f[](1)\[aq]s
  29. \f[B]\-S\f[] option.
  30. This session is used in lieu of starting a session and using the PCR
  31. policy options.
  32. .RE
  33. .SS References
  34. .SH COMMON OPTIONS
  35. .PP
  36. This collection of options are common to many programs and provide
  37. information that many users may expect.
  38. .IP \[bu] 2
  39. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  40. manpage.
  41. By default, it attempts to invoke the manpager for the tool, however, on
  42. failure will output a short tool summary.
  43. This is the same behavior if the "man" option argument is specified,
  44. however if explicit "man" is requested, the tool will provide errors
  45. from man on stderr.
  46. If the "no\-man" option if specified, or the manpager fails, the short
  47. options will be output to stdout.
  48. .RS 2
  49. .PP
  50. To successfully use the manpages feature requires the manpages to be
  51. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  52. .RE
  53. .IP \[bu] 2
  54. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  55. tool, supported tctis and exit.
  56. .IP \[bu] 2
  57. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  58. tool prints to the console during its execution.
  59. When using this option the file and line number are printed.
  60. .IP \[bu] 2
  61. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  62. .IP \[bu] 2
  63. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  64. errata fixups.
  65. Useful if an errata fixup needs to be applied to commands sent to the
  66. TPM.
  67. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  68. information many users may expect.
  69. .SH TCTI Configuration
  70. .PP
  71. The TCTI or "Transmission Interface" is the communication mechanism with
  72. the TPM.
  73. TCTIs can be changed for communication with TPMs across different
  74. mediums.
  75. .PP
  76. To control the TCTI, the tools respect:
  77. .IP "1." 3
  78. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  79. .IP "2." 3
  80. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  81. .PP
  82. \f[B]Note:\f[] The command line option always overrides the environment
  83. variable.
  84. .PP
  85. The current known TCTIs are:
  86. .IP \[bu] 2
  87. tabrmd \- The resource manager, called
  88. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  89. Note that tabrmd and abrmd as a tcti name are synonymous.
  90. .IP \[bu] 2
  91. mssim \- Typically used for communicating to the TPM software simulator.
  92. .IP \[bu] 2
  93. device \- Used when talking directly to a TPM device file.
  94. .IP \[bu] 2
  95. none \- Do not initalize a connection with the TPM.
  96. Some tools allow for off\-tpm options and thus support not using a TCTI.
  97. Tools that do not support it will error when attempted to be used
  98. without a TCTI connection.
  99. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  100. the exact text of "none".
  101. .PP
  102. The arguments to either the command line option or the environment
  103. variable are in the form:
  104. .PP
  105. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  106. .PP
  107. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  108. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  109. that portion respectively.
  110. .SS TCTI Defaults
  111. .PP
  112. When a TCTI is not specified, the default TCTI is searched for using
  113. \f[I]dlopen(3)\f[] semantics.
  114. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  115. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  116. FOUND\f[].
  117. You can query what TCTI will be chosen as the default by using the
  118. \f[B]\-v\f[] option to print the version information.
  119. The "default\-tcti" key\-value pair will indicate which of the
  120. aforementioned TCTIs is the default.
  121. .SS Custom TCTIs
  122. .PP
  123. Any TCTI that implements the dynamic TCTI interface can be loaded.
  124. The tools internally use \f[I]dlopen(3)\f[], and the raw
  125. \f[I]tcti\-name\f[] value is used for the lookup.
  126. Thus, this could be a path to the shared library, or a library name as
  127. understood by \f[I]dlopen(3)\f[] semantics.
  128. .SH TCTI OPTIONS
  129. .PP
  130. This collection of options are used to configure the various known TCTI
  131. modules available:
  132. .IP \[bu] 2
  133. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  134. use by the device TCTI can be specified.
  135. The default is \f[I]/dev/tpm0\f[].
  136. .RS 2
  137. .PP
  138. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  139. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  140. .RE
  141. .IP \[bu] 2
  142. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  143. port number used by the simulator can be specified.
  144. The default are 127.0.0.1 and 2321.
  145. .RS 2
  146. .PP
  147. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  148. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  149. .RE
  150. .IP \[bu] 2
  151. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  152. series of simple key value pairs separated by a \[aq],\[aq] character.
  153. Each key and value string are separated by a \[aq]=\[aq] character.
  154. .RS 2
  155. .IP \[bu] 2
  156. TCTI abrmd supports two keys:
  157. .RS 2
  158. .IP "1." 3
  159. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  160. string).
  161. .IP "2." 3
  162. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  163. \[aq]session\[aq] and \[aq]system\[aq].
  164. .RE
  165. .PP
  166. Specify the tabrmd tcti name and a config string of
  167. \f[C]bus_name=com.example.FooBar\f[]:
  168. .PP
  169. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  170. .PP
  171. Specify the default (abrmd) tcti and a config string of
  172. \f[C]bus_type=session\f[]:
  173. .PP
  174. \f[C]\\\-\-tcti:bus_type=session\f[]
  175. .PP
  176. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  177. the various known TCTI modules.
  178. .RE
  179. .SH EXAMPLES
  180. .SS Start a \f[I]policy\f[] session and restart it, unsealing some data.
  181. .IP
  182. .nf
  183. \f[C]
  184. #\ create\ a\ policy\ and\ bind\ it\ to\ an\ object
  185. tpm2_startauthsession\ \-S\ session.dat
  186. tpm2_policypcr\ \-S\ session.dat\ \-l\ "sha1:0,1,2,3"\ \-L\ policy.dat
  187. tpm2_createprimary\ \-c\ primary.ctx
  188. tpm2_create\ \-Cprimary.ctx\ \-u\ key.pub\ \-r\ key.priv\ \-L\ policy.dat\ \-i\-\ <<<\ "secret"
  189. tpm2_load\ \-C\ primary.ctx\ \-c\ key.ctx\ \-u\ key.pub\ \-r\ key.priv
  190. tpm2_flushcontext\ session.dat
  191. #\ satisfy\ the\ policy\ and\ use\ the\ object
  192. tpm2_startauthsession\ \-\-policy\ \-S\ session.dat
  193. tpm2_policypcr\ \-S\ session.dat\ \-l\ "sha1:0,1,2,3"
  194. #\ PCR\ event\ occurs\ here\ causing\ unseal\ to\ fail
  195. tpm2_pcrevent\ 0\ <<<\ "event\ data"
  196. tpm2_unseal\ \-psession:session.dat\ \-c\ key.ct
  197. ERROR:\ Esys_Unseal(0x128)\ \-\ tpm:error(2.0):\ PCR\ have\ changed\ since\ checked
  198. #\ Clear\ the\ policy\ digest\ to\ initial\ state,\ note\ access\ to\ object\ no\ longer\ allowed\ by
  199. #\ policy\ so\ policyor\ would\ be\ useful\ here.
  200. tpm2_policyrestart\ \-S\ session.dat
  201. \f[]
  202. .fi
  203. .SH Returns
  204. .PP
  205. Tools can return any of the following codes:
  206. .IP \[bu] 2
  207. 0 \- Success.
  208. .IP \[bu] 2
  209. 1 \- General non\-specific error.
  210. .IP \[bu] 2
  211. 2 \- Options handling error.
  212. .IP \[bu] 2
  213. 3 \- Authentication error.
  214. .IP \[bu] 2
  215. 4 \- TCTI related error.
  216. .IP \[bu] 2
  217. 5 \- Non supported scheme.
  218. Applicable to tpm2_testparams.
  219. .SH Limitations
  220. .PP
  221. It expects a session to be already established via
  222. \f[B]tpm2_startauthsession\f[](1) and requires one of the following:
  223. .IP \[bu] 2
  224. direct device access
  225. .IP \[bu] 2
  226. extended session support with \f[B]tpm2\-abrmd\f[].
  227. .PP
  228. Without it, most resource managers \f[B]will not\f[] save session state
  229. between command invocations.
  230. .SH BUGS
  231. .PP
  232. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  233. .SH HELP
  234. .PP
  235. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)