tpm2_pcrread.1 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_pcrread" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_pcrread\f[](1) \- List PCR values.
  8. .SH SYNOPSIS
  9. .PP
  10. \f[B]tpm2_pcrread\f[] [\f[I]OPTIONS\f[]] \f[I]PCR_LIST_OR_ALG\f[]
  11. .SH DESCRIPTION
  12. .PP
  13. \f[B]tpm2_pcrread\f[](1) \- Displays PCR values.
  14. Without any arguments, \f[B]tpm2_pcrread\f[](1) outputs all PCRs and
  15. their hash banks.
  16. One can use specify the hash algorithm or a pcr list as an argument to
  17. filter the output.
  18. .PP
  19. To only output PCR banks with a given algorithm, specify the hashing
  20. algorithm as the argument.
  21. Algorithms should follow the "formatting standards", see section
  22. "Algorithm Specifiers".
  23. Also, see section "Supported Hash Algorithms" for a list of supported
  24. hash algorithms.
  25. .PP
  26. To output a list of PCR banks (sha1, sha256, etc) and ids (0, 1, 2 etc)
  27. specify a PCR selection list as the argument as specified via section
  28. "PCR Bank Specifiers".
  29. .PP
  30. Also read \f[B]NOTES\f[] section below.
  31. .PP
  32. Output is written in a YAML format to stdout, with each algorithm
  33. followed by a PCR index and its value.
  34. As a simple example assume just sha1 and sha256 support and only 1 PCR.
  35. The output would be:
  36. .IP
  37. .nf
  38. \f[C]
  39. $\ tpm2_pcrread\ sha1:0+sha256:0
  40. sha1\ :
  41. \ \ 0\ \ :\ 0000000000000000000000000000000000000003
  42. sha256\ :
  43. \ \ 0\ \ :\ 0000000000000000000000000000000000000000000000000000000000000003
  44. \f[]
  45. .fi
  46. .SH OPTIONS
  47. .IP \[bu] 2
  48. \f[B]\-o\f[], \f[B]\-\-output\f[]=\f[I]FILE\f[]:
  49. .RS 2
  50. .PP
  51. The output file to write the PCR values in binary format, optional.
  52. .RE
  53. .SH COMMON OPTIONS
  54. .PP
  55. This collection of options are common to many programs and provide
  56. information that many users may expect.
  57. .IP \[bu] 2
  58. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  59. manpage.
  60. By default, it attempts to invoke the manpager for the tool, however, on
  61. failure will output a short tool summary.
  62. This is the same behavior if the "man" option argument is specified,
  63. however if explicit "man" is requested, the tool will provide errors
  64. from man on stderr.
  65. If the "no\-man" option if specified, or the manpager fails, the short
  66. options will be output to stdout.
  67. .RS 2
  68. .PP
  69. To successfully use the manpages feature requires the manpages to be
  70. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  71. .RE
  72. .IP \[bu] 2
  73. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  74. tool, supported tctis and exit.
  75. .IP \[bu] 2
  76. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  77. tool prints to the console during its execution.
  78. When using this option the file and line number are printed.
  79. .IP \[bu] 2
  80. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  81. .IP \[bu] 2
  82. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  83. errata fixups.
  84. Useful if an errata fixup needs to be applied to commands sent to the
  85. TPM.
  86. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  87. .SH TCTI Configuration
  88. .PP
  89. The TCTI or "Transmission Interface" is the communication mechanism with
  90. the TPM.
  91. TCTIs can be changed for communication with TPMs across different
  92. mediums.
  93. .PP
  94. To control the TCTI, the tools respect:
  95. .IP "1." 3
  96. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  97. .IP "2." 3
  98. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  99. .PP
  100. \f[B]Note:\f[] The command line option always overrides the environment
  101. variable.
  102. .PP
  103. The current known TCTIs are:
  104. .IP \[bu] 2
  105. tabrmd \- The resource manager, called
  106. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  107. Note that tabrmd and abrmd as a tcti name are synonymous.
  108. .IP \[bu] 2
  109. mssim \- Typically used for communicating to the TPM software simulator.
  110. .IP \[bu] 2
  111. device \- Used when talking directly to a TPM device file.
  112. .IP \[bu] 2
  113. none \- Do not initalize a connection with the TPM.
  114. Some tools allow for off\-tpm options and thus support not using a TCTI.
  115. Tools that do not support it will error when attempted to be used
  116. without a TCTI connection.
  117. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  118. the exact text of "none".
  119. .PP
  120. The arguments to either the command line option or the environment
  121. variable are in the form:
  122. .PP
  123. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  124. .PP
  125. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  126. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  127. that portion respectively.
  128. .SS TCTI Defaults
  129. .PP
  130. When a TCTI is not specified, the default TCTI is searched for using
  131. \f[I]dlopen(3)\f[] semantics.
  132. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  133. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  134. FOUND\f[].
  135. You can query what TCTI will be chosen as the default by using the
  136. \f[B]\-v\f[] option to print the version information.
  137. The "default\-tcti" key\-value pair will indicate which of the
  138. aforementioned TCTIs is the default.
  139. .SS Custom TCTIs
  140. .PP
  141. Any TCTI that implements the dynamic TCTI interface can be loaded.
  142. The tools internally use \f[I]dlopen(3)\f[], and the raw
  143. \f[I]tcti\-name\f[] value is used for the lookup.
  144. Thus, this could be a path to the shared library, or a library name as
  145. understood by \f[I]dlopen(3)\f[] semantics.
  146. .SH TCTI OPTIONS
  147. .PP
  148. This collection of options are used to configure the various known TCTI
  149. modules available:
  150. .IP \[bu] 2
  151. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  152. use by the device TCTI can be specified.
  153. The default is \f[I]/dev/tpm0\f[].
  154. .RS 2
  155. .PP
  156. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  157. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  158. .RE
  159. .IP \[bu] 2
  160. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  161. port number used by the simulator can be specified.
  162. The default are 127.0.0.1 and 2321.
  163. .RS 2
  164. .PP
  165. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  166. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  167. .RE
  168. .IP \[bu] 2
  169. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  170. series of simple key value pairs separated by a \[aq],\[aq] character.
  171. Each key and value string are separated by a \[aq]=\[aq] character.
  172. .RS 2
  173. .IP \[bu] 2
  174. TCTI abrmd supports two keys:
  175. .RS 2
  176. .IP "1." 3
  177. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  178. string).
  179. .IP "2." 3
  180. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  181. \[aq]session\[aq] and \[aq]system\[aq].
  182. .RE
  183. .PP
  184. Specify the tabrmd tcti name and a config string of
  185. \f[C]bus_name=com.example.FooBar\f[]:
  186. .PP
  187. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  188. .PP
  189. Specify the default (abrmd) tcti and a config string of
  190. \f[C]bus_type=session\f[]:
  191. .PP
  192. \f[C]\\\-\-tcti:bus_type=session\f[]
  193. .PP
  194. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  195. .RE
  196. .PP
  197. PCR bank specifiers (common/pcr.md)
  198. .SH Supported Hash Algorithms
  199. .PP
  200. Supported hash algorithms are:
  201. .IP \[bu] 2
  202. \f[B]0x4\f[] or \f[B]sha1\f[] for \f[B]TPM_ALG_SHA1\f[]
  203. .IP \[bu] 2
  204. \f[B]0xB\f[] or \f[B]sha256\f[] for \f[B]TPM_ALG_SHA256\f[]
  205. \f[B](default)\f[]
  206. .IP \[bu] 2
  207. \f[B]0xC\f[] or \f[B]sha384\f[] for \f[B]TPM_ALG_SHA384\f[]
  208. .IP \[bu] 2
  209. \f[B]0xD\f[] or \f[B]sha512\f[] for \f[B]TPM_ALG_SHA512\f[]
  210. .IP \[bu] 2
  211. \f[B]0x12\f[] or \f[B]sm3_256\f[] for \f[B]TPM_ALG_SM3_256\f[]
  212. .PP
  213. \f[B]NOTE\f[]: Your TPM may not support all algorithms.
  214. .SH Algorithm Specifiers
  215. .PP
  216. Options that take algorithms support "nice\-names".
  217. .PP
  218. There are two major algorithm specification string classes, simple and
  219. complex.
  220. Only certain algorithms will be accepted by the TPM, based on usage and
  221. conditions.
  222. .SS Simple specifiers
  223. .PP
  224. These are strings with no additional specification data.
  225. When creating objects, non\-specified portions of an object are assumed
  226. to defaults.
  227. You can find the list of known "Simple Specifiers Below".
  228. .SS Asymmetric
  229. .IP \[bu] 2
  230. rsa
  231. .IP \[bu] 2
  232. ecc
  233. .SS Symmetric
  234. .IP \[bu] 2
  235. aes
  236. .IP \[bu] 2
  237. camellia
  238. .SS Hashing Algorithms
  239. .IP \[bu] 2
  240. sha1
  241. .IP \[bu] 2
  242. sha256
  243. .IP \[bu] 2
  244. sha384
  245. .IP \[bu] 2
  246. sha512
  247. .IP \[bu] 2
  248. sm3_256
  249. .IP \[bu] 2
  250. sha3_256
  251. .IP \[bu] 2
  252. sha3_384
  253. .IP \[bu] 2
  254. sha3_512
  255. .SS Keyed Hash
  256. .IP \[bu] 2
  257. hmac
  258. .IP \[bu] 2
  259. xor
  260. .SS Signing Schemes
  261. .IP \[bu] 2
  262. rsassa
  263. .IP \[bu] 2
  264. rsapss
  265. .IP \[bu] 2
  266. ecdsa
  267. .IP \[bu] 2
  268. ecdaa
  269. .IP \[bu] 2
  270. ecschnorr
  271. .SS Asymmetric Encryption Schemes
  272. .IP \[bu] 2
  273. oaep
  274. .IP \[bu] 2
  275. rsaes
  276. .IP \[bu] 2
  277. ecdh
  278. .SS Modes
  279. .IP \[bu] 2
  280. ctr
  281. .IP \[bu] 2
  282. ofb
  283. .IP \[bu] 2
  284. cbc
  285. .IP \[bu] 2
  286. cfb
  287. .IP \[bu] 2
  288. ecb
  289. .SS Misc
  290. .IP \[bu] 2
  291. null
  292. .SS Complex Specifiers
  293. .PP
  294. Objects, when specified for creation by the TPM, have numerous
  295. algorithms to populate in the public data.
  296. Things like type, scheme and asymmetric details, key size, etc.
  297. Below is the general format for specifying this data:
  298. \f[C]<type>:<scheme>:<symmetric\-details>\f[]
  299. .SS Type Specifiers
  300. .PP
  301. This portion of the complex algorithm specifier is required.
  302. The remaining scheme and symmetric details will default based on the
  303. type specified and the type of the object being created.
  304. .IP \[bu] 2
  305. aes \- Default AES: aes128
  306. .IP \[bu] 2
  307. aes128\f[C]<mode>\f[] \- 128 bit AES with optional mode
  308. (\f[I]ctr\f[]|\f[I]ofb\f[]|\f[I]cbc\f[]|\f[I]cfb\f[]|\f[I]ecb\f[]).
  309. If mode is not specified, defaults to \f[I]null\f[].
  310. .IP \[bu] 2
  311. aes192\f[C]<mode>\f[] \- Same as aes128\f[C]<mode>\f[], except for a 192
  312. bit key size.
  313. .IP \[bu] 2
  314. aes256\f[C]<mode>\f[] \- Same as aes128\f[C]<mode>\f[], except for a 256
  315. bit key size.
  316. .IP \[bu] 2
  317. ecc \- Elliptical Curve, defaults to ecc256.
  318. .IP \[bu] 2
  319. ecc192 \- 192 bit ECC
  320. .IP \[bu] 2
  321. ecc224 \- 224 bit ECC
  322. .IP \[bu] 2
  323. ecc256 \- 256 bit ECC
  324. .IP \[bu] 2
  325. ecc384 \- 384 bit ECC
  326. .IP \[bu] 2
  327. ecc521 \- 521 bit ECC
  328. .IP \[bu] 2
  329. rsa \- Default RSA: rsa2048
  330. .IP \[bu] 2
  331. rsa1024 \- RSA with 1024 bit keysize.
  332. .IP \[bu] 2
  333. rsa2048 \- RSA with 2048 bit keysize.
  334. .IP \[bu] 2
  335. rsa4096 \- RSA with 4096 bit keysize.
  336. .SS Scheme Specifiers
  337. .PP
  338. Next, is an optional field, it can be skipped.
  339. .PP
  340. Schemes are usually \f[B]Signing Schemes\f[] or \f[B]Asymmetric
  341. Encryption Schemes\f[].
  342. Most signing schemes take a hash algorithm directly following the
  343. signing scheme.
  344. If the hash algorithm is missing, it defaults to \f[I]sha256\f[].
  345. Some take no arguments, and some take multiple arguments.
  346. .SS Hash Optional Scheme Specifiers
  347. .PP
  348. These scheme specifiers are followed by a dash and a valid hash
  349. algorithm, For example: \f[C]oaep\-sha256\f[].
  350. .IP \[bu] 2
  351. oaep
  352. .IP \[bu] 2
  353. ecdh
  354. .IP \[bu] 2
  355. rsassa
  356. .IP \[bu] 2
  357. rsapss
  358. .IP \[bu] 2
  359. ecdsa
  360. .IP \[bu] 2
  361. ecschnorr
  362. .SS Multiple Option Scheme Specifiers
  363. .PP
  364. This scheme specifier is followed by a count (max size UINT16) then
  365. followed by a dash(\-) and a valid hash algorithm.
  366. * ecdaa For example, ecdaa4\-sha256.
  367. If no count is specified, it defaults to 4.
  368. .SS No Option Scheme Specifiers
  369. .PP
  370. This scheme specifier takes NO arguments.
  371. * rsaes
  372. .SS Symmetric Details Specifiers
  373. .PP
  374. This field is optional, and defaults based on the \f[I]type\f[] of
  375. object being created and it\[aq]s attributes.
  376. Generally, any valid \f[B]Symmetric\f[] specifier from the \f[B]Type
  377. Specifiers\f[] list should work.
  378. If not specified, an asymmetric objects symmetric details defaults to
  379. \f[I]aes128cfb\f[].
  380. .SS Examples
  381. .SS Create an rsa2048 key with an rsaes asymmetric encryption scheme
  382. .PP
  383. \f[C]tpm2_create\ \-C\ parent.ctx\ \-G\ rsa2048:rsaes\ \-u\ key.pub\ \-r\ key.priv\f[]
  384. .SS Create an ecc256 key with an ecdaa signing scheme with a count of 4
  385. and sha384 hash
  386. .PP
  387. \f[C]/tpm2_create\ \-C\ parent.ctx\ \-G\ ecc256:ecdaa4\-sha384\ \-u\ key.pub\ \-r\ key.priv\f[]
  388. .SH EXAMPLES
  389. .SS Display all PCR values
  390. .IP
  391. .nf
  392. \f[C]
  393. tpm2_pcrread
  394. \f[]
  395. .fi
  396. .SS Display the PCR values with a specified bank
  397. .IP
  398. .nf
  399. \f[C]
  400. tpm2_pcrread\ sha1
  401. \f[]
  402. .fi
  403. .SS Display the PCR values with specified banks and store in a file
  404. .IP
  405. .nf
  406. \f[C]
  407. tpm2_pcrread\ \-o\ pcrs\ sha1:16,17,18+sha256:16,17,18
  408. \f[]
  409. .fi
  410. .SS Display the supported PCR bank algorithms and exit
  411. .IP
  412. .nf
  413. \f[C]
  414. tpm2_pcrread
  415. \f[]
  416. .fi
  417. .SH NOTES
  418. .PP
  419. The maximum number of PCR that can be dumped at once is associated with
  420. the maximum length of a bank.
  421. .PP
  422. On most TPMs, it means that this tool can dump up to 24 PCRs at once.
  423. .SH Returns
  424. .PP
  425. Tools can return any of the following codes:
  426. .IP \[bu] 2
  427. 0 \- Success.
  428. .IP \[bu] 2
  429. 1 \- General non\-specific error.
  430. .IP \[bu] 2
  431. 2 \- Options handling error.
  432. .IP \[bu] 2
  433. 3 \- Authentication error.
  434. .IP \[bu] 2
  435. 4 \- TCTI related error.
  436. .IP \[bu] 2
  437. 5 \- Non supported scheme.
  438. Applicable to tpm2_testparams.
  439. .SH BUGS
  440. .PP
  441. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  442. .SH HELP
  443. .PP
  444. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)