tpm2_nvreadpublic.1 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_nvreadpublic" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_nvreadpublic\f[](1) \- Display all defined Non\-Volatile (NV)s
  8. indices.
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]tpm2_nvreadpublic\f[] [\f[I]OPTIONS\f[]]
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]tpm2_nvreadpublic\f[](1) \- Display all defined Non\-Volatile (NV)s
  15. indices to stdout in a YAML format.
  16. .PP
  17. Display metadata for all defined NV indices.
  18. Metadata includes:
  19. .IP \[bu] 2
  20. The size of the defined region.
  21. .IP \[bu] 2
  22. The hash algorithm used to compute the name of the index.
  23. .IP \[bu] 2
  24. The auth policy.
  25. .IP \[bu] 2
  26. The NV attributes as defined in section "NV Attributes".
  27. .SS Example Output
  28. .PP
  29. ``` 0x1500015: hash algorithm: friendly: sha256 value: 0xB attributes:
  30. friendly: ownerwrite|ownerread value: 0x2000200 size: 32 authorization
  31. policy:
  32. .PP
  33. 0x1500017: hash algorithm: friendly: sha256 value: 0xB attributes:
  34. friendly: ownerwrite|ownerread value: 0x2000200 size: 32 authorization
  35. policy: ```
  36. .SH OPTIONS
  37. .PP
  38. This tool takes no tool specific options.
  39. .SH COMMON OPTIONS
  40. .PP
  41. This collection of options are common to many programs and provide
  42. information that many users may expect.
  43. .IP \[bu] 2
  44. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  45. manpage.
  46. By default, it attempts to invoke the manpager for the tool, however, on
  47. failure will output a short tool summary.
  48. This is the same behavior if the "man" option argument is specified,
  49. however if explicit "man" is requested, the tool will provide errors
  50. from man on stderr.
  51. If the "no\-man" option if specified, or the manpager fails, the short
  52. options will be output to stdout.
  53. .RS 2
  54. .PP
  55. To successfully use the manpages feature requires the manpages to be
  56. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  57. .RE
  58. .IP \[bu] 2
  59. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  60. tool, supported tctis and exit.
  61. .IP \[bu] 2
  62. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  63. tool prints to the console during its execution.
  64. When using this option the file and line number are printed.
  65. .IP \[bu] 2
  66. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  67. .IP \[bu] 2
  68. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  69. errata fixups.
  70. Useful if an errata fixup needs to be applied to commands sent to the
  71. TPM.
  72. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  73. .SH TCTI Configuration
  74. .PP
  75. The TCTI or "Transmission Interface" is the communication mechanism with
  76. the TPM.
  77. TCTIs can be changed for communication with TPMs across different
  78. mediums.
  79. .PP
  80. To control the TCTI, the tools respect:
  81. .IP "1." 3
  82. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  83. .IP "2." 3
  84. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  85. .PP
  86. \f[B]Note:\f[] The command line option always overrides the environment
  87. variable.
  88. .PP
  89. The current known TCTIs are:
  90. .IP \[bu] 2
  91. tabrmd \- The resource manager, called
  92. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  93. Note that tabrmd and abrmd as a tcti name are synonymous.
  94. .IP \[bu] 2
  95. mssim \- Typically used for communicating to the TPM software simulator.
  96. .IP \[bu] 2
  97. device \- Used when talking directly to a TPM device file.
  98. .IP \[bu] 2
  99. none \- Do not initalize a connection with the TPM.
  100. Some tools allow for off\-tpm options and thus support not using a TCTI.
  101. Tools that do not support it will error when attempted to be used
  102. without a TCTI connection.
  103. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  104. the exact text of "none".
  105. .PP
  106. The arguments to either the command line option or the environment
  107. variable are in the form:
  108. .PP
  109. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  110. .PP
  111. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  112. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  113. that portion respectively.
  114. .SS TCTI Defaults
  115. .PP
  116. When a TCTI is not specified, the default TCTI is searched for using
  117. \f[I]dlopen(3)\f[] semantics.
  118. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  119. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  120. FOUND\f[].
  121. You can query what TCTI will be chosen as the default by using the
  122. \f[B]\-v\f[] option to print the version information.
  123. The "default\-tcti" key\-value pair will indicate which of the
  124. aforementioned TCTIs is the default.
  125. .SS Custom TCTIs
  126. .PP
  127. Any TCTI that implements the dynamic TCTI interface can be loaded.
  128. The tools internally use \f[I]dlopen(3)\f[], and the raw
  129. \f[I]tcti\-name\f[] value is used for the lookup.
  130. Thus, this could be a path to the shared library, or a library name as
  131. understood by \f[I]dlopen(3)\f[] semantics.
  132. .SH TCTI OPTIONS
  133. .PP
  134. This collection of options are used to configure the various known TCTI
  135. modules available:
  136. .IP \[bu] 2
  137. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  138. use by the device TCTI can be specified.
  139. The default is \f[I]/dev/tpm0\f[].
  140. .RS 2
  141. .PP
  142. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  143. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  144. .RE
  145. .IP \[bu] 2
  146. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  147. port number used by the simulator can be specified.
  148. The default are 127.0.0.1 and 2321.
  149. .RS 2
  150. .PP
  151. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  152. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  153. .RE
  154. .IP \[bu] 2
  155. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  156. series of simple key value pairs separated by a \[aq],\[aq] character.
  157. Each key and value string are separated by a \[aq]=\[aq] character.
  158. .RS 2
  159. .IP \[bu] 2
  160. TCTI abrmd supports two keys:
  161. .RS 2
  162. .IP "1." 3
  163. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  164. string).
  165. .IP "2." 3
  166. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  167. \[aq]session\[aq] and \[aq]system\[aq].
  168. .RE
  169. .PP
  170. Specify the tabrmd tcti name and a config string of
  171. \f[C]bus_name=com.example.FooBar\f[]:
  172. .PP
  173. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  174. .PP
  175. Specify the default (abrmd) tcti and a config string of
  176. \f[C]bus_type=session\f[]:
  177. .PP
  178. \f[C]\\\-\-tcti:bus_type=session\f[]
  179. .PP
  180. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  181. .RE
  182. .SH NV Attributes
  183. .PP
  184. NV Attributes are used to control various properties of the NV defined
  185. space.
  186. When specified as an option, either the raw bitfield mask or
  187. "nice\-names" may be used.
  188. The values can be found in Table 204 Part 2 of the TPM2.0 specification,
  189. which can be found here:
  190. .PP
  191. <https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf>
  192. .PP
  193. Nice names are calculated by taking the name field of table 204 and
  194. removing the prefix \f[B]TPMA_NV_\f[] and lowercasing the result.
  195. Thus, \f[B]TPMA_NV_PPWRITE\f[] becomes ppwrite.
  196. Nice names can be joined using the bitwise or "|" symbol.
  197. .PP
  198. Note that the \f[B]TPM_NT\f[] field is 4 bits wide, and thus can be set
  199. via \f[B]nt=\f[] format.
  200. For instance, to set The fields \f[B]TPMA_NV_OWNERREAD\f[],
  201. \f[B]TPMA_NV_OWNERWRITE\f[], \f[B]TPMA_NV_POLICYWRITE\f[], and
  202. \f[B]TPMA_NT = 0x2\f[], the argument would be:
  203. .PP
  204. \f[B]ownerread|ownerwrite|policywrite|nt=0x2\f[]
  205. .PP
  206. Additionally, the NT field, which denotes the type of the NV index, can
  207. also be specified via friendly names: * ordinary \- Ordinary contains
  208. data that is opaque to the TPM that can only be modified using
  209. TPM2_NV_Write.
  210. * extend \- Extend is used similarly to a PCR and can only be modified
  211. with TPM2_NV_Extend.
  212. Its size is determined by the length of the hash algorithm used.
  213. * counter \- Counter contains an 8\-octet value that is to be used as a
  214. counter and can only be modified with TPM2_NV_Increment * bits \- Bit
  215. Field contains an 8\-octet value to be used as a bit field and can only
  216. be modified with TPM2_NV_SetBits.
  217. * pinfail \- PIN Fail contains an 8\-octet pinCount that increments on a
  218. PIN authorization failure and a pinLimit.
  219. * pinpass \- PIN Pass contains an 8\-octet pinCount that increments on a
  220. PIN authorization success and a pinLimit.
  221. .PP
  222. For instance, to set The fields \f[B]TPMA_NV_OWNERREAD\f[],
  223. \f[B]TPMA_NV_OWNERWRITE\f[], \f[B]TPMA_NV_POLICYWRITE\f[], and
  224. \f[B]TPMA_NT = bits\f[], the argument would be:
  225. .PP
  226. \f[B]ownerread|ownerwrite|policywrite|nt=bits\f[]
  227. .SH EXAMPLES
  228. .SS List the defined NV indices to stdout
  229. .IP
  230. .nf
  231. \f[C]
  232. tpm2_nvreadpublic
  233. \f[]
  234. .fi
  235. .SH Returns
  236. .PP
  237. Tools can return any of the following codes:
  238. .IP \[bu] 2
  239. 0 \- Success.
  240. .IP \[bu] 2
  241. 1 \- General non\-specific error.
  242. .IP \[bu] 2
  243. 2 \- Options handling error.
  244. .IP \[bu] 2
  245. 3 \- Authentication error.
  246. .IP \[bu] 2
  247. 4 \- TCTI related error.
  248. .IP \[bu] 2
  249. 5 \- Non supported scheme.
  250. Applicable to tpm2_testparams.
  251. .SH BUGS
  252. .PP
  253. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  254. .SH HELP
  255. .PP
  256. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)