tpm2_quote.1 13 KB

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