tpm2_getcommandauditdigest.1 12 KB

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