tpm2_flushcontext.1 7.6 KB

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