tpm2_readclock.1 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_readclock" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_readclock\f[](1) \- Retrieves the time information from the
  8. TPM.
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]tpm2_readclock\f[] [\f[I]OPTIONS\f[]]
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]tpm2_readclock\f[](1) \-Reads the current TPMS_TIME_INFO structure
  15. from the TPM.
  16. The structure contains the current setting of Time, Clock, resetCount,
  17. and restartCount.
  18. The structure is output as YAML to stdout.
  19. The YAML output is defined as:
  20. .IP
  21. .nf
  22. \f[C]
  23. time:\ 13673142\ \ \ \ \ #\ 64\ bit\ value\ of\ time\ TPM\ has\ been\ powered\ on\ in\ ms.
  24. clock_info:
  25. \ \ clock:\ 13673142\ \ #\ 64\ bit\ value\ of\ time\ TPM\ has\ been\ powered\ on\ since\ last\ TPM2_Clear\ in\ ms.
  26. \ \ reset_count:\ 0\ \ \ #\ 32\ bit\ value\ of\ the\ number\ of\ TPM\ Resets\ since\ the\ last
  27. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ TPM2_Clear.
  28. \ \ restart_count:\ 0\ #\ 32\ bit\ value\ of\ the\ number\ of\ times\ that\ TPM2_Shutdown\ or
  29. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ _TPM_Hash_Start\ have\ occurred\ since\ the\ last\ TPM\ Reset\ or
  30. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ TPM2_Clear.
  31. \ \ safe:\ yes\ \ \ \ \ \ \ \ #\ boolean\ yes|no\ value\ that\ no\ value\ of\ Clock\ greater\ than
  32. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ the\ current\ value\ of\ Clock\ has\ been\ previously\ reported\ by
  33. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ the\ TPM.
  34. \f[]
  35. .fi
  36. .PP
  37. This tool takes no arguments and no tool specific options.
  38. .SS References
  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. information many users may expect.
  74. .SH TCTI Configuration
  75. .PP
  76. The TCTI or "Transmission Interface" is the communication mechanism with
  77. the TPM.
  78. TCTIs can be changed for communication with TPMs across different
  79. mediums.
  80. .PP
  81. To control the TCTI, the tools respect:
  82. .IP "1." 3
  83. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  84. .IP "2." 3
  85. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  86. .PP
  87. \f[B]Note:\f[] The command line option always overrides the environment
  88. variable.
  89. .PP
  90. The current known TCTIs are:
  91. .IP \[bu] 2
  92. tabrmd \- The resource manager, called
  93. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  94. Note that tabrmd and abrmd as a tcti name are synonymous.
  95. .IP \[bu] 2
  96. mssim \- Typically used for communicating to the TPM software simulator.
  97. .IP \[bu] 2
  98. device \- Used when talking directly to a TPM device file.
  99. .IP \[bu] 2
  100. none \- Do not initalize a connection with the TPM.
  101. Some tools allow for off\-tpm options and thus support not using a TCTI.
  102. Tools that do not support it will error when attempted to be used
  103. without a TCTI connection.
  104. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  105. the exact text of "none".
  106. .PP
  107. The arguments to either the command line option or the environment
  108. variable are in the form:
  109. .PP
  110. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  111. .PP
  112. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  113. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  114. that portion respectively.
  115. .SS TCTI Defaults
  116. .PP
  117. When a TCTI is not specified, the default TCTI is searched for using
  118. \f[I]dlopen(3)\f[] semantics.
  119. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  120. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  121. FOUND\f[].
  122. You can query what TCTI will be chosen as the default by using the
  123. \f[B]\-v\f[] option to print the version information.
  124. The "default\-tcti" key\-value pair will indicate which of the
  125. aforementioned TCTIs is the default.
  126. .SS Custom TCTIs
  127. .PP
  128. Any TCTI that implements the dynamic TCTI interface can be loaded.
  129. The tools internally use \f[I]dlopen(3)\f[], and the raw
  130. \f[I]tcti\-name\f[] value is used for the lookup.
  131. Thus, this could be a path to the shared library, or a library name as
  132. understood by \f[I]dlopen(3)\f[] semantics.
  133. .SH TCTI OPTIONS
  134. .PP
  135. This collection of options are used to configure the various known TCTI
  136. modules available:
  137. .IP \[bu] 2
  138. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  139. use by the device TCTI can be specified.
  140. The default is \f[I]/dev/tpm0\f[].
  141. .RS 2
  142. .PP
  143. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  144. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  145. .RE
  146. .IP \[bu] 2
  147. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  148. port number used by the simulator can be specified.
  149. The default are 127.0.0.1 and 2321.
  150. .RS 2
  151. .PP
  152. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  153. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  154. .RE
  155. .IP \[bu] 2
  156. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  157. series of simple key value pairs separated by a \[aq],\[aq] character.
  158. Each key and value string are separated by a \[aq]=\[aq] character.
  159. .RS 2
  160. .IP \[bu] 2
  161. TCTI abrmd supports two keys:
  162. .RS 2
  163. .IP "1." 3
  164. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  165. string).
  166. .IP "2." 3
  167. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  168. \[aq]session\[aq] and \[aq]system\[aq].
  169. .RE
  170. .PP
  171. Specify the tabrmd tcti name and a config string of
  172. \f[C]bus_name=com.example.FooBar\f[]:
  173. .PP
  174. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  175. .PP
  176. Specify the default (abrmd) tcti and a config string of
  177. \f[C]bus_type=session\f[]:
  178. .PP
  179. \f[C]\\\-\-tcti:bus_type=session\f[]
  180. .PP
  181. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  182. the various known TCTI modules.
  183. .RE
  184. .SH EXAMPLES
  185. .SS Read the clock
  186. .IP
  187. .nf
  188. \f[C]
  189. tpm2_readclock
  190. time:\ 13673142
  191. clock_info:
  192. \ \ clock:\ 13673142
  193. \ \ reset_count:\ 0
  194. \ \ restart_count:\ 0
  195. \ \ safe:\ yes
  196. \f[]
  197. .fi
  198. .SH Returns
  199. .PP
  200. Tools can return any of the following codes:
  201. .IP \[bu] 2
  202. 0 \- Success.
  203. .IP \[bu] 2
  204. 1 \- General non\-specific error.
  205. .IP \[bu] 2
  206. 2 \- Options handling error.
  207. .IP \[bu] 2
  208. 3 \- Authentication error.
  209. .IP \[bu] 2
  210. 4 \- TCTI related error.
  211. .IP \[bu] 2
  212. 5 \- Non supported scheme.
  213. Applicable to tpm2_testparams.
  214. .SH BUGS
  215. .PP
  216. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  217. .SH HELP
  218. .PP
  219. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)