tpm2_stirrandom.1 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_stirrandom" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_stirrandom\f[](1) \- Add "additional information" into TPM RNG
  8. state.
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]tpm2_stirrandom\f[] [\f[I]OPTIONS\f[]] [\f[I]ARGUMENT\f[]]
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]tpm2_stirrandom\f[](1) \- Inject "additional information" as bytes
  15. into TPM entropy Protected Capability pool.
  16. .PP
  17. "Additional information" can be extracted from file specified as
  18. argument or being read from \f[I]STDIN\f[] if argument is not specified.
  19. .PP
  20. Up to 128 bytes can be injected at once through standard input to
  21. \f[B]tpm2_stirrandom\f[](1).
  22. .PP
  23. If input file is larger than 128 bytes, \f[B]tpm2_stirrandom\f[](1) will
  24. fail.
  25. .PP
  26. Adding data through \f[B]tpm2_stirrandom\f[](1) will trigger a reseeding
  27. of TPM DRBG Protected Capability.
  28. It is used when performing any sensitive action on a shielded location
  29. such as loading a persistent key or acting on a Protected Capability
  30. like updating TPM firmware.
  31. .SH OPTIONS
  32. .PP
  33. This command has no option
  34. .SS References
  35. .SH COMMON OPTIONS
  36. .PP
  37. This collection of options are common to many programs and provide
  38. information that many users may expect.
  39. .IP \[bu] 2
  40. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  41. manpage.
  42. By default, it attempts to invoke the manpager for the tool, however, on
  43. failure will output a short tool summary.
  44. This is the same behavior if the "man" option argument is specified,
  45. however if explicit "man" is requested, the tool will provide errors
  46. from man on stderr.
  47. If the "no\-man" option if specified, or the manpager fails, the short
  48. options will be output to stdout.
  49. .RS 2
  50. .PP
  51. To successfully use the manpages feature requires the manpages to be
  52. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  53. .RE
  54. .IP \[bu] 2
  55. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  56. tool, supported tctis and exit.
  57. .IP \[bu] 2
  58. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  59. tool prints to the console during its execution.
  60. When using this option the file and line number are printed.
  61. .IP \[bu] 2
  62. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  63. .IP \[bu] 2
  64. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  65. errata fixups.
  66. Useful if an errata fixup needs to be applied to commands sent to the
  67. TPM.
  68. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  69. information many users may expect.
  70. .SH TCTI Configuration
  71. .PP
  72. The TCTI or "Transmission Interface" is the communication mechanism with
  73. the TPM.
  74. TCTIs can be changed for communication with TPMs across different
  75. mediums.
  76. .PP
  77. To control the TCTI, the tools respect:
  78. .IP "1." 3
  79. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  80. .IP "2." 3
  81. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  82. .PP
  83. \f[B]Note:\f[] The command line option always overrides the environment
  84. variable.
  85. .PP
  86. The current known TCTIs are:
  87. .IP \[bu] 2
  88. tabrmd \- The resource manager, called
  89. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  90. Note that tabrmd and abrmd as a tcti name are synonymous.
  91. .IP \[bu] 2
  92. mssim \- Typically used for communicating to the TPM software simulator.
  93. .IP \[bu] 2
  94. device \- Used when talking directly to a TPM device file.
  95. .IP \[bu] 2
  96. none \- Do not initalize a connection with the TPM.
  97. Some tools allow for off\-tpm options and thus support not using a TCTI.
  98. Tools that do not support it will error when attempted to be used
  99. without a TCTI connection.
  100. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  101. the exact text of "none".
  102. .PP
  103. The arguments to either the command line option or the environment
  104. variable are in the form:
  105. .PP
  106. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  107. .PP
  108. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  109. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  110. that portion respectively.
  111. .SS TCTI Defaults
  112. .PP
  113. When a TCTI is not specified, the default TCTI is searched for using
  114. \f[I]dlopen(3)\f[] semantics.
  115. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  116. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  117. FOUND\f[].
  118. You can query what TCTI will be chosen as the default by using the
  119. \f[B]\-v\f[] option to print the version information.
  120. The "default\-tcti" key\-value pair will indicate which of the
  121. aforementioned TCTIs is the default.
  122. .SS Custom TCTIs
  123. .PP
  124. Any TCTI that implements the dynamic TCTI interface can be loaded.
  125. The tools internally use \f[I]dlopen(3)\f[], and the raw
  126. \f[I]tcti\-name\f[] value is used for the lookup.
  127. Thus, this could be a path to the shared library, or a library name as
  128. understood by \f[I]dlopen(3)\f[] semantics.
  129. .SH TCTI OPTIONS
  130. .PP
  131. This collection of options are used to configure the various known TCTI
  132. modules available:
  133. .IP \[bu] 2
  134. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  135. use by the device TCTI can be specified.
  136. The default is \f[I]/dev/tpm0\f[].
  137. .RS 2
  138. .PP
  139. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  140. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  141. .RE
  142. .IP \[bu] 2
  143. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  144. port number used by the simulator can be specified.
  145. The default are 127.0.0.1 and 2321.
  146. .RS 2
  147. .PP
  148. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  149. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  150. .RE
  151. .IP \[bu] 2
  152. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  153. series of simple key value pairs separated by a \[aq],\[aq] character.
  154. Each key and value string are separated by a \[aq]=\[aq] character.
  155. .RS 2
  156. .IP \[bu] 2
  157. TCTI abrmd supports two keys:
  158. .RS 2
  159. .IP "1." 3
  160. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  161. string).
  162. .IP "2." 3
  163. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  164. \[aq]session\[aq] and \[aq]system\[aq].
  165. .RE
  166. .PP
  167. Specify the tabrmd tcti name and a config string of
  168. \f[C]bus_name=com.example.FooBar\f[]:
  169. .PP
  170. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  171. .PP
  172. Specify the default (abrmd) tcti and a config string of
  173. \f[C]bus_type=session\f[]:
  174. .PP
  175. \f[C]\\\-\-tcti:bus_type=session\f[]
  176. .PP
  177. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  178. the various known TCTI modules.)
  179. .RE
  180. .SH EXAMPLES
  181. .SS Inject from stdin using echo
  182. .IP
  183. .nf
  184. \f[C]
  185. echo\ \-n\ "myrandomdata"\ |\ tpm2_stirrandom
  186. \f[]
  187. .fi
  188. .SS Inject 64 bytes from stdin using a file
  189. .IP
  190. .nf
  191. \f[C]
  192. dd\ if=/dev/urandom\ bs=1\ count=64\ >\ myrandom.bin
  193. tpm2_stirrandom\ <\ ./myrandom.bin
  194. \f[]
  195. .fi
  196. .SS Inject bytes from a file and reading up to 128 bytes
  197. .IP
  198. .nf
  199. \f[C]
  200. dd\ if=/dev/urandom\ of=./myrandom.bin\ bs=1\ count=42
  201. tpm2_stirrandom\ ./myrandom.bin
  202. \f[]
  203. .fi
  204. .SH NOTES
  205. .PP
  206. Please be aware that even if the "additional information" added by
  207. \f[B]tpm2_stirrandom\f[](1) can be entropy gathered from other DRBG
  208. sources, the TPM has no way of determining if the value has any entropy
  209. or not.
  210. As a consequence, it will just be considered as "additional input".
  211. .PP
  212. The "additional input" is as defined in NIST
  213. SP800\-90A (https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-90.pdf)
  214. .SH Returns
  215. .PP
  216. Tools can return any of the following codes:
  217. .IP \[bu] 2
  218. 0 \- Success.
  219. .IP \[bu] 2
  220. 1 \- General non\-specific error.
  221. .IP \[bu] 2
  222. 2 \- Options handling error.
  223. .IP \[bu] 2
  224. 3 \- Authentication error.
  225. .IP \[bu] 2
  226. 4 \- TCTI related error.
  227. .IP \[bu] 2
  228. 5 \- Non supported scheme.
  229. Applicable to tpm2_testparams.
  230. .SH BUGS
  231. .PP
  232. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  233. .SH HELP
  234. .PP
  235. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)