tpm2_commit.1 12 KB

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