tpm2_hierarchycontrol.1 11 KB

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