tpm2_getsessionauditdigest.1 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_getsessionauditdigest" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_getsessionauditdigest\f[](1) \- Retrieve the command audit
  8. attestation data from the TPM.
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]tpm2_getsessionauditdigest\f[] [\f[I]OPTIONS\f[]]
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]tpm2_getsessionauditdigest\f[](1) \- Retrieve the session audit
  15. digest attestation data from the TPM.
  16. The attestation data includes the session audit digest and a signature
  17. over the session audit digest.
  18. The session itself is started with the \f[B]tpm2_startauthsession\f[]
  19. command.
  20. .SH OPTIONS
  21. .IP \[bu] 2
  22. \f[B]\-P\f[], \f[B]\-\-hierarchy\-auth\f[]=\f[I]AUTH\f[]:
  23. .RS 2
  24. .PP
  25. Specifies the authorization value for the endorsement hierarchy.
  26. .RE
  27. .IP \[bu] 2
  28. \f[B]\-c\f[], \f[B]\-\-key\-context\f[]=\f[I]OBJECT\f[]:
  29. .RS 2
  30. .PP
  31. Context object for the signing key that signs the attestation data.
  32. .RE
  33. .IP \[bu] 2
  34. \f[B]\-p\f[], \f[B]\-\-auth\f[]=\f[I]AUTH\f[]:
  35. .RS 2
  36. .PP
  37. Specifies the authorization value for key specified by option
  38. \f[B]\-c\f[].
  39. .RE
  40. .IP \[bu] 2
  41. \f[B]\-q\f[], \f[B]\-\-qualification\f[]=\f[I]HEX_STRING_OR_PATH\f[]:
  42. .RS 2
  43. .PP
  44. Data given as a Hex string or binary file to qualify the quote,
  45. optional.
  46. This is typically used to add a nonce against replay attacks.
  47. .RE
  48. .IP \[bu] 2
  49. \f[B]\-s\f[], \f[B]\-\-signature\f[]=\f[I]FILE\f[]:
  50. .RS 2
  51. .PP
  52. Signature output file, records the signature in the format specified via
  53. the \f[B]\-f\f[] option.
  54. .RE
  55. .IP \[bu] 2
  56. \f[B]\-m\f[], \f[B]\-\-message\f[]=\f[I]FILE\f[]:
  57. .RS 2
  58. .PP
  59. Message output file, records the quote message that makes up the data
  60. that is signed by the TPM.
  61. This is the command audit digest attestation data.
  62. .RE
  63. .IP \[bu] 2
  64. \f[B]\-f\f[], \f[B]\-\-format\f[]=\f[I]FORMAT\f[]:
  65. .RS 2
  66. .PP
  67. Format selection for the signature output file.
  68. .RE
  69. .IP \[bu] 2
  70. \f[B]\-g\f[], \f[B]\-\-hash\-algorithm\f[]:
  71. .RS 2
  72. .PP
  73. Hash algorithm for signature.
  74. Defaults to sha256.
  75. .RE
  76. .IP \[bu] 2
  77. \f[B]\-S\f[], \f[B]\-\-session\f[]=\f[I]FILE\f[]:
  78. .RS 2
  79. .PP
  80. The path of the session that enables and records the audit digests.
  81. .RE
  82. .SS References
  83. .SH Context Object Format
  84. .PP
  85. The type of a context object, whether it is a handle or file name, is
  86. determined according to the following logic \f[I]in\-order\f[]:
  87. .IP \[bu] 2
  88. If the argument is a file path, then the file is loaded as a restored
  89. TPM transient object.
  90. .IP \[bu] 2
  91. If the argument is a \f[I]prefix\f[] match on one of:
  92. .RS 2
  93. .IP \[bu] 2
  94. owner: the owner hierarchy
  95. .IP \[bu] 2
  96. platform: the platform hierarchy
  97. .IP \[bu] 2
  98. endorsement: the endorsement hierarchy
  99. .IP \[bu] 2
  100. lockout: the lockout control persistent object
  101. .RE
  102. .IP \[bu] 2
  103. If the argument argument can be loaded as a number it will be treat as a
  104. handle, e.g.
  105. 0x81010013 and used directly.\f[I]OBJECT\f[].
  106. .SH Authorization Formatting
  107. .PP
  108. Authorization for use of an object in TPM2.0 can come in 3 different
  109. forms: 1.
  110. Password 2.
  111. HMAC 3.
  112. Sessions
  113. .PP
  114. \f[B]NOTE:\f[] "Authorizations default to the \f[B]EMPTY PASSWORD\f[]
  115. when not specified".
  116. .SS Passwords
  117. .PP
  118. Passwords are interpreted in the following forms below using prefix
  119. identifiers.
  120. .PP
  121. \f[B]Note\f[]: By default passwords are assumed to be in the string form
  122. when they do not have a prefix.
  123. .SS String
  124. .PP
  125. A string password, specified by prefix "str:" or it\[aq]s absence (raw
  126. string without prefix) is not interpreted, and is directly used for
  127. authorization.
  128. .SS Examples
  129. .IP
  130. .nf
  131. \f[C]
  132. foobar
  133. str:foobar
  134. \f[]
  135. .fi
  136. .SS Hex\-string
  137. .PP
  138. A hex\-string password, specified by prefix "hex:" is converted from a
  139. hexidecimal form into a byte array form, thus allowing passwords with
  140. non\-printable and/or terminal un\-friendly characters.
  141. .SS Example
  142. .IP
  143. .nf
  144. \f[C]
  145. hex:0x1122334455667788
  146. \f[]
  147. .fi
  148. .SS File
  149. .PP
  150. A file based password, specified be prefix "file:" should be the path of
  151. a file containing the password to be read by the tool or a "\-" to use
  152. stdin.
  153. Storing passwords in files prevents information leakage, passwords
  154. passed as options can be read from the process list or common shell
  155. history features.
  156. .SS Examples
  157. .IP
  158. .nf
  159. \f[C]
  160. #\ to\ use\ stdin\ and\ be\ prompted
  161. file:\-
  162. #\ to\ use\ a\ file\ from\ a\ path
  163. file:path/to/password/file
  164. #\ to\ echo\ a\ password\ via\ stdin:
  165. echo\ foobar\ |\ tpm2_tool\ \-p\ file:\-
  166. #\ to\ use\ a\ bash\ here\-string\ via\ stdin:
  167. tpm2_tool\ \-p\ file:\-\ <<<\ foobar
  168. \f[]
  169. .fi
  170. .SS Sessions
  171. .PP
  172. When using a policy session to authorize the use of an object, prefix
  173. the option argument with the \f[I]session\f[] keyword.
  174. Then indicate a path to a session file that was created with
  175. tpm2_startauthsession(1).
  176. Optionally, if the session requires an auth value to be sent with the
  177. session handle (eg policy password), then append a + and a string as
  178. described in the \f[B]Passwords\f[] section.
  179. .SS Examples
  180. .PP
  181. To use a session context file called \f[I]session.ctx\f[].
  182. .IP
  183. .nf
  184. \f[C]
  185. session:session.ctx
  186. \f[]
  187. .fi
  188. .PP
  189. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  190. send the authvalue mypassword.
  191. .IP
  192. .nf
  193. \f[C]
  194. session:session.ctx+mypassword
  195. \f[]
  196. .fi
  197. .PP
  198. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  199. send the \f[I]HEX\f[] authvalue 0x11223344.
  200. .IP
  201. .nf
  202. \f[C]
  203. session:session.ctx+hex:11223344
  204. \f[]
  205. .fi
  206. .SS PCR Authorizations
  207. .PP
  208. You can satisfy a PCR policy using the "pcr:" prefix and the PCR
  209. minilanguage.
  210. The PCR minilanguage is as follows:
  211. \f[C]<pcr\-spec>=<raw\-pcr\-file>\f[]
  212. .PP
  213. The PCR spec is documented in in the section "PCR bank specifiers".
  214. .PP
  215. The \f[C]raw\-pcr\-file\f[] is an \f[B]optional\f[] the output of the
  216. raw PCR contents as returned by \f[I]tpm2_pcrread(1)\f[].
  217. .PP
  218. PCR bank specifiers (common/pcr.md)
  219. .SS Examples
  220. .PP
  221. To satisfy a PCR policy of sha256 on banks 0, 1, 2 and 3 use a specifier
  222. of:
  223. .IP
  224. .nf
  225. \f[C]
  226. pcr:sha256:0,1,2,3
  227. \f[]
  228. .fi
  229. .PP
  230. specifying \f[I]AUTH\f[].
  231. .SH Signature Format Specifiers
  232. .PP
  233. Format selection for the signature output file.
  234. \f[B]tss\f[] (the default) will output a binary blob according to the
  235. TPM 2.0 specification and any potential compiler padding.
  236. The option \f[B]plain\f[] will output the plain signature data as
  237. defined by the used cryptographic algorithm.
  238. signature \f[I]FORMAT\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. .IP
  386. .nf
  387. \f[C]
  388. tpm2_createprimary\ \-Q\ \-C\ e\ \-c\ prim.ctx
  389. tpm2_create\ \-Q\ \-C\ prim.ctx\ \-c\ signing_key.ctx\ \-u\ signing_key.pub\ \\
  390. \-r\ signing_key.priv
  391. tpm2_startauthsession\ \-S\ session.ctx\ \-\-audit\-session
  392. tpm2_getrandom\ 8\ \-S\ session.ctx
  393. tpm2_getsessionauditdigest\ \-c\ signing_key.ctx\ \-m\ att.data\ \-s\ att.sig\ \\
  394. \-S\ session.ctx
  395. \f[]
  396. .fi
  397. .SH Returns
  398. .PP
  399. Tools can return any of the following codes:
  400. .IP \[bu] 2
  401. 0 \- Success.
  402. .IP \[bu] 2
  403. 1 \- General non\-specific error.
  404. .IP \[bu] 2
  405. 2 \- Options handling error.
  406. .IP \[bu] 2
  407. 3 \- Authentication error.
  408. .IP \[bu] 2
  409. 4 \- TCTI related error.
  410. .IP \[bu] 2
  411. 5 \- Non supported scheme.
  412. Applicable to tpm2_testparams.
  413. .SH BUGS
  414. .PP
  415. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  416. .SH HELP
  417. .PP
  418. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)