tpm2_testparms.1 11 KB

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