tpm2_checkquote.1 13 KB

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