tpm2_evictcontrol.1 13 KB

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