tpm2_clear.1 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_clear" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_clear\f[](1) \- Clears lockout, endorsement and owner
  8. hierarchy authorization values.
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]tpm2_clear\f[] [\f[I]OPTIONS\f[]] [\f[I]ARGUMENT\f[]]
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]tpm2_clear\f[](1) \- Send a clear command to the TPM to clear the 3
  15. hierarchy authorization values.
  16. As an argument takes the auth value for either platform or lockout
  17. hierarchy
  18. .PP
  19. \f[B]NOTE\f[]: All objects created under the respective hierarchies are
  20. lost.
  21. .SH OPTIONS
  22. .IP \[bu] 2
  23. \f[B]\-c\f[], \f[B]\-\-auth\-hierarchy\f[]=\f[I]OBJECT\f[]:
  24. .RS 2
  25. .PP
  26. Specifies the hierarchy the tools should operate on.
  27. By default it operates on the lockout hierarchy.
  28. .PP
  29. \f[B]NOTE : Operating on platform hierarchy require platform
  30. authentication.\f[]
  31. .RE
  32. .IP \[bu] 2
  33. \f[B]\-\-cphash\f[]=\f[I]FILE\f[]
  34. .RS 2
  35. .PP
  36. File path to record the hash of the command parameters.
  37. This is commonly termed as cpHash.
  38. NOTE: When this option is selected, The tool will not actually execute
  39. the command, it simply returns a cpHash.
  40. .RE
  41. .IP \[bu] 2
  42. \f[B]ARGUMENT\f[] the command line argument specifies the \f[I]AUTH\f[]
  43. to be set for the object specified with \f[B]\-c\f[].
  44. .SS References
  45. .SH Context Object Format
  46. .PP
  47. The type of a context object, whether it is a handle or file name, is
  48. determined according to the following logic \f[I]in\-order\f[]:
  49. .IP \[bu] 2
  50. If the argument is a file path, then the file is loaded as a restored
  51. TPM transient object.
  52. .IP \[bu] 2
  53. If the argument is a \f[I]prefix\f[] match on one of:
  54. .RS 2
  55. .IP \[bu] 2
  56. owner: the owner hierarchy
  57. .IP \[bu] 2
  58. platform: the platform hierarchy
  59. .IP \[bu] 2
  60. endorsement: the endorsement hierarchy
  61. .IP \[bu] 2
  62. lockout: the lockout control persistent object
  63. .RE
  64. .IP \[bu] 2
  65. If the argument argument can be loaded as a number it will be treat as a
  66. handle, e.g.
  67. 0x81010013 and used directly.\f[I]OBJECT\f[].
  68. .SH Authorization Formatting
  69. .PP
  70. Authorization for use of an object in TPM2.0 can come in 3 different
  71. forms: 1.
  72. Password 2.
  73. HMAC 3.
  74. Sessions
  75. .PP
  76. \f[B]NOTE:\f[] "Authorizations default to the \f[B]EMPTY PASSWORD\f[]
  77. when not specified".
  78. .SS Passwords
  79. .PP
  80. Passwords are interpreted in the following forms below using prefix
  81. identifiers.
  82. .PP
  83. \f[B]Note\f[]: By default passwords are assumed to be in the string form
  84. when they do not have a prefix.
  85. .SS String
  86. .PP
  87. A string password, specified by prefix "str:" or it\[aq]s absence (raw
  88. string without prefix) is not interpreted, and is directly used for
  89. authorization.
  90. .SS Examples
  91. .IP
  92. .nf
  93. \f[C]
  94. foobar
  95. str:foobar
  96. \f[]
  97. .fi
  98. .SS Hex\-string
  99. .PP
  100. A hex\-string password, specified by prefix "hex:" is converted from a
  101. hexidecimal form into a byte array form, thus allowing passwords with
  102. non\-printable and/or terminal un\-friendly characters.
  103. .SS Example
  104. .IP
  105. .nf
  106. \f[C]
  107. hex:0x1122334455667788
  108. \f[]
  109. .fi
  110. .SS File
  111. .PP
  112. A file based password, specified be prefix "file:" should be the path of
  113. a file containing the password to be read by the tool or a "\-" to use
  114. stdin.
  115. Storing passwords in files prevents information leakage, passwords
  116. passed as options can be read from the process list or common shell
  117. history features.
  118. .SS Examples
  119. .IP
  120. .nf
  121. \f[C]
  122. #\ to\ use\ stdin\ and\ be\ prompted
  123. file:\-
  124. #\ to\ use\ a\ file\ from\ a\ path
  125. file:path/to/password/file
  126. #\ to\ echo\ a\ password\ via\ stdin:
  127. echo\ foobar\ |\ tpm2_tool\ \-p\ file:\-
  128. #\ to\ use\ a\ bash\ here\-string\ via\ stdin:
  129. tpm2_tool\ \-p\ file:\-\ <<<\ foobar
  130. \f[]
  131. .fi
  132. .SS Sessions
  133. .PP
  134. When using a policy session to authorize the use of an object, prefix
  135. the option argument with the \f[I]session\f[] keyword.
  136. Then indicate a path to a session file that was created with
  137. tpm2_startauthsession(1).
  138. Optionally, if the session requires an auth value to be sent with the
  139. session handle (eg policy password), then append a + and a string as
  140. described in the \f[B]Passwords\f[] section.
  141. .SS Examples
  142. .PP
  143. To use a session context file called \f[I]session.ctx\f[].
  144. .IP
  145. .nf
  146. \f[C]
  147. session:session.ctx
  148. \f[]
  149. .fi
  150. .PP
  151. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  152. send the authvalue mypassword.
  153. .IP
  154. .nf
  155. \f[C]
  156. session:session.ctx+mypassword
  157. \f[]
  158. .fi
  159. .PP
  160. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  161. send the \f[I]HEX\f[] authvalue 0x11223344.
  162. .IP
  163. .nf
  164. \f[C]
  165. session:session.ctx+hex:11223344
  166. \f[]
  167. .fi
  168. .SS PCR Authorizations
  169. .PP
  170. You can satisfy a PCR policy using the "pcr:" prefix and the PCR
  171. minilanguage.
  172. The PCR minilanguage is as follows:
  173. \f[C]<pcr\-spec>=<raw\-pcr\-file>\f[]
  174. .PP
  175. The PCR spec is documented in in the section "PCR bank specifiers".
  176. .PP
  177. The \f[C]raw\-pcr\-file\f[] is an \f[B]optional\f[] the output of the
  178. raw PCR contents as returned by \f[I]tpm2_pcrread(1)\f[].
  179. .PP
  180. PCR bank specifiers (common/pcr.md)
  181. .SS Examples
  182. .PP
  183. To satisfy a PCR policy of sha256 on banks 0, 1, 2 and 3 use a specifier
  184. of:
  185. .IP
  186. .nf
  187. \f[C]
  188. pcr:sha256:0,1,2,3
  189. \f[]
  190. .fi
  191. .PP
  192. specifying \f[I]AUTH\f[].
  193. .SH COMMON OPTIONS
  194. .PP
  195. This collection of options are common to many programs and provide
  196. information that many users may expect.
  197. .IP \[bu] 2
  198. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  199. manpage.
  200. By default, it attempts to invoke the manpager for the tool, however, on
  201. failure will output a short tool summary.
  202. This is the same behavior if the "man" option argument is specified,
  203. however if explicit "man" is requested, the tool will provide errors
  204. from man on stderr.
  205. If the "no\-man" option if specified, or the manpager fails, the short
  206. options will be output to stdout.
  207. .RS 2
  208. .PP
  209. To successfully use the manpages feature requires the manpages to be
  210. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  211. .RE
  212. .IP \[bu] 2
  213. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  214. tool, supported tctis and exit.
  215. .IP \[bu] 2
  216. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  217. tool prints to the console during its execution.
  218. When using this option the file and line number are printed.
  219. .IP \[bu] 2
  220. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  221. .IP \[bu] 2
  222. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  223. errata fixups.
  224. Useful if an errata fixup needs to be applied to commands sent to the
  225. TPM.
  226. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  227. information many users may expect.
  228. .SH TCTI Configuration
  229. .PP
  230. The TCTI or "Transmission Interface" is the communication mechanism with
  231. the TPM.
  232. TCTIs can be changed for communication with TPMs across different
  233. mediums.
  234. .PP
  235. To control the TCTI, the tools respect:
  236. .IP "1." 3
  237. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  238. .IP "2." 3
  239. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  240. .PP
  241. \f[B]Note:\f[] The command line option always overrides the environment
  242. variable.
  243. .PP
  244. The current known TCTIs are:
  245. .IP \[bu] 2
  246. tabrmd \- The resource manager, called
  247. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  248. Note that tabrmd and abrmd as a tcti name are synonymous.
  249. .IP \[bu] 2
  250. mssim \- Typically used for communicating to the TPM software simulator.
  251. .IP \[bu] 2
  252. device \- Used when talking directly to a TPM device file.
  253. .IP \[bu] 2
  254. none \- Do not initalize a connection with the TPM.
  255. Some tools allow for off\-tpm options and thus support not using a TCTI.
  256. Tools that do not support it will error when attempted to be used
  257. without a TCTI connection.
  258. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  259. the exact text of "none".
  260. .PP
  261. The arguments to either the command line option or the environment
  262. variable are in the form:
  263. .PP
  264. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  265. .PP
  266. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  267. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  268. that portion respectively.
  269. .SS TCTI Defaults
  270. .PP
  271. When a TCTI is not specified, the default TCTI is searched for using
  272. \f[I]dlopen(3)\f[] semantics.
  273. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  274. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  275. FOUND\f[].
  276. You can query what TCTI will be chosen as the default by using the
  277. \f[B]\-v\f[] option to print the version information.
  278. The "default\-tcti" key\-value pair will indicate which of the
  279. aforementioned TCTIs is the default.
  280. .SS Custom TCTIs
  281. .PP
  282. Any TCTI that implements the dynamic TCTI interface can be loaded.
  283. The tools internally use \f[I]dlopen(3)\f[], and the raw
  284. \f[I]tcti\-name\f[] value is used for the lookup.
  285. Thus, this could be a path to the shared library, or a library name as
  286. understood by \f[I]dlopen(3)\f[] semantics.
  287. .SH TCTI OPTIONS
  288. .PP
  289. This collection of options are used to configure the various known TCTI
  290. modules available:
  291. .IP \[bu] 2
  292. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  293. use by the device TCTI can be specified.
  294. The default is \f[I]/dev/tpm0\f[].
  295. .RS 2
  296. .PP
  297. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  298. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  299. .RE
  300. .IP \[bu] 2
  301. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  302. port number used by the simulator can be specified.
  303. The default are 127.0.0.1 and 2321.
  304. .RS 2
  305. .PP
  306. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  307. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  308. .RE
  309. .IP \[bu] 2
  310. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  311. series of simple key value pairs separated by a \[aq],\[aq] character.
  312. Each key and value string are separated by a \[aq]=\[aq] character.
  313. .RS 2
  314. .IP \[bu] 2
  315. TCTI abrmd supports two keys:
  316. .RS 2
  317. .IP "1." 3
  318. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  319. string).
  320. .IP "2." 3
  321. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  322. \[aq]session\[aq] and \[aq]system\[aq].
  323. .RE
  324. .PP
  325. Specify the tabrmd tcti name and a config string of
  326. \f[C]bus_name=com.example.FooBar\f[]:
  327. .PP
  328. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  329. .PP
  330. Specify the default (abrmd) tcti and a config string of
  331. \f[C]bus_type=session\f[]:
  332. .PP
  333. \f[C]\\\-\-tcti:bus_type=session\f[]
  334. .PP
  335. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  336. the various known TCTI modules.
  337. .RE
  338. .SH EXAMPLES
  339. .SS Set owner, endorsement and lockout authorizations to an empty value
  340. .IP
  341. .nf
  342. \f[C]
  343. tpm2_clear\ lockoutpasswd
  344. \f[]
  345. .fi
  346. .SS Clear the authorization values on the platform hierarchy
  347. .IP
  348. .nf
  349. \f[C]
  350. tpm2_clear\ \-c\ p
  351. \f[]
  352. .fi
  353. .SH Returns
  354. .PP
  355. Tools can return any of the following codes:
  356. .IP \[bu] 2
  357. 0 \- Success.
  358. .IP \[bu] 2
  359. 1 \- General non\-specific error.
  360. .IP \[bu] 2
  361. 2 \- Options handling error.
  362. .IP \[bu] 2
  363. 3 \- Authentication error.
  364. .IP \[bu] 2
  365. 4 \- TCTI related error.
  366. .IP \[bu] 2
  367. 5 \- Non supported scheme.
  368. Applicable to tpm2_testparams.
  369. .SH BUGS
  370. .PP
  371. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  372. .SH HELP
  373. .PP
  374. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)