tpm2_clockrateadjust.1 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_clockrateadjust" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_clockrateadjust\f[](1) \- Sets the clock rate period on the
  8. TPM.
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]tpm2_clockrateadjust\f[] [\f[I]OPTIONS\f[]] \f[B]ADJUSTER\f[]
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]tpm2_clockrateadjust\f[](1) \- Adjusts the rate at which clock and
  15. time are updated on the TPM so one can better match real time.
  16. With no argument, the command is invoked but the clock rate is not
  17. altered.
  18. With an argument, the tool will adjust the clock and time period.
  19. The command can either increase or decrease the clock period via 3
  20. distinct granularities: course, medium and fine.
  21. To specify this, the argument can be a string of 1 to 3 characters of
  22. \f[I]all\f[] \[aq]s\[aq] or \[aq]f\[aq].
  23. .SS Valid Adjuster Arguments
  24. .IP \[bu] 2
  25. s \- slows down the clock period one fine increment.
  26. .IP \[bu] 2
  27. ss \- slows down the clock period one medium increment.
  28. .IP \[bu] 2
  29. sss \- slows down the clock period one course increment.
  30. .IP \[bu] 2
  31. f \- speeds up the clock period one fine increment.
  32. .IP \[bu] 2
  33. ff \- speeds up the clock period one medium increment.
  34. .IP \[bu] 2
  35. fff \- speeds up the clock period one course increment.
  36. .SH OPTIONS
  37. .IP \[bu] 2
  38. \f[B]\-c\f[], \f[B]\-\-hierarchy\f[]=\f[I]OBJECT\f[]:
  39. .RS 2
  40. .PP
  41. The hierarchy to use for authorization, either platform or owner.
  42. Defaults to the owner hierarchy if not specified.
  43. .RE
  44. .IP \[bu] 2
  45. \f[B]\-p\f[], \f[B]\-\-auth\f[]=\f[I]AUTH\f[]:
  46. .RS 2
  47. .PP
  48. Specifies the authorization value for the hierarchy specified by option
  49. \f[B]\-c\f[].
  50. .RE
  51. .IP \[bu] 2
  52. \f[B]\-\-cphash\f[]=\f[I]FILE\f[]
  53. .RS 2
  54. .PP
  55. File path to record the hash of the command parameters.
  56. This is commonly termed as cpHash.
  57. NOTE: When this option is selected, The tool will not actually execute
  58. the command, it simply returns a cpHash.
  59. .RE
  60. .SS References
  61. .SH Context Object Format
  62. .PP
  63. The type of a context object, whether it is a handle or file name, is
  64. determined according to the following logic \f[I]in\-order\f[]:
  65. .IP \[bu] 2
  66. If the argument is a file path, then the file is loaded as a restored
  67. TPM transient object.
  68. .IP \[bu] 2
  69. If the argument is a \f[I]prefix\f[] match on one of:
  70. .RS 2
  71. .IP \[bu] 2
  72. owner: the owner hierarchy
  73. .IP \[bu] 2
  74. platform: the platform hierarchy
  75. .IP \[bu] 2
  76. endorsement: the endorsement hierarchy
  77. .IP \[bu] 2
  78. lockout: the lockout control persistent object
  79. .RE
  80. .IP \[bu] 2
  81. If the argument argument can be loaded as a number it will be treat as a
  82. handle, e.g.
  83. 0x81010013 and used directly.\f[I]OBJECT\f[].
  84. .SH Authorization Formatting
  85. .PP
  86. Authorization for use of an object in TPM2.0 can come in 3 different
  87. forms: 1.
  88. Password 2.
  89. HMAC 3.
  90. Sessions
  91. .PP
  92. \f[B]NOTE:\f[] "Authorizations default to the \f[B]EMPTY PASSWORD\f[]
  93. when not specified".
  94. .SS Passwords
  95. .PP
  96. Passwords are interpreted in the following forms below using prefix
  97. identifiers.
  98. .PP
  99. \f[B]Note\f[]: By default passwords are assumed to be in the string form
  100. when they do not have a prefix.
  101. .SS String
  102. .PP
  103. A string password, specified by prefix "str:" or it\[aq]s absence (raw
  104. string without prefix) is not interpreted, and is directly used for
  105. authorization.
  106. .SS Examples
  107. .IP
  108. .nf
  109. \f[C]
  110. foobar
  111. str:foobar
  112. \f[]
  113. .fi
  114. .SS Hex\-string
  115. .PP
  116. A hex\-string password, specified by prefix "hex:" is converted from a
  117. hexidecimal form into a byte array form, thus allowing passwords with
  118. non\-printable and/or terminal un\-friendly characters.
  119. .SS Example
  120. .IP
  121. .nf
  122. \f[C]
  123. hex:0x1122334455667788
  124. \f[]
  125. .fi
  126. .SS File
  127. .PP
  128. A file based password, specified be prefix "file:" should be the path of
  129. a file containing the password to be read by the tool or a "\-" to use
  130. stdin.
  131. Storing passwords in files prevents information leakage, passwords
  132. passed as options can be read from the process list or common shell
  133. history features.
  134. .SS Examples
  135. .IP
  136. .nf
  137. \f[C]
  138. #\ to\ use\ stdin\ and\ be\ prompted
  139. file:\-
  140. #\ to\ use\ a\ file\ from\ a\ path
  141. file:path/to/password/file
  142. #\ to\ echo\ a\ password\ via\ stdin:
  143. echo\ foobar\ |\ tpm2_tool\ \-p\ file:\-
  144. #\ to\ use\ a\ bash\ here\-string\ via\ stdin:
  145. tpm2_tool\ \-p\ file:\-\ <<<\ foobar
  146. \f[]
  147. .fi
  148. .SS Sessions
  149. .PP
  150. When using a policy session to authorize the use of an object, prefix
  151. the option argument with the \f[I]session\f[] keyword.
  152. Then indicate a path to a session file that was created with
  153. tpm2_startauthsession(1).
  154. Optionally, if the session requires an auth value to be sent with the
  155. session handle (eg policy password), then append a + and a string as
  156. described in the \f[B]Passwords\f[] section.
  157. .SS Examples
  158. .PP
  159. To use a session context file called \f[I]session.ctx\f[].
  160. .IP
  161. .nf
  162. \f[C]
  163. session:session.ctx
  164. \f[]
  165. .fi
  166. .PP
  167. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  168. send the authvalue mypassword.
  169. .IP
  170. .nf
  171. \f[C]
  172. session:session.ctx+mypassword
  173. \f[]
  174. .fi
  175. .PP
  176. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  177. send the \f[I]HEX\f[] authvalue 0x11223344.
  178. .IP
  179. .nf
  180. \f[C]
  181. session:session.ctx+hex:11223344
  182. \f[]
  183. .fi
  184. .SS PCR Authorizations
  185. .PP
  186. You can satisfy a PCR policy using the "pcr:" prefix and the PCR
  187. minilanguage.
  188. The PCR minilanguage is as follows:
  189. \f[C]<pcr\-spec>=<raw\-pcr\-file>\f[]
  190. .PP
  191. The PCR spec is documented in in the section "PCR bank specifiers".
  192. .PP
  193. The \f[C]raw\-pcr\-file\f[] is an \f[B]optional\f[] the output of the
  194. raw PCR contents as returned by \f[I]tpm2_pcrread(1)\f[].
  195. .PP
  196. PCR bank specifiers (common/pcr.md)
  197. .SS Examples
  198. .PP
  199. To satisfy a PCR policy of sha256 on banks 0, 1, 2 and 3 use a specifier
  200. of:
  201. .IP
  202. .nf
  203. \f[C]
  204. pcr:sha256:0,1,2,3
  205. \f[]
  206. .fi
  207. .PP
  208. specifying \f[I]AUTH\f[].
  209. .SH COMMON OPTIONS
  210. .PP
  211. This collection of options are common to many programs and provide
  212. information that many users may expect.
  213. .IP \[bu] 2
  214. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  215. manpage.
  216. By default, it attempts to invoke the manpager for the tool, however, on
  217. failure will output a short tool summary.
  218. This is the same behavior if the "man" option argument is specified,
  219. however if explicit "man" is requested, the tool will provide errors
  220. from man on stderr.
  221. If the "no\-man" option if specified, or the manpager fails, the short
  222. options will be output to stdout.
  223. .RS 2
  224. .PP
  225. To successfully use the manpages feature requires the manpages to be
  226. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  227. .RE
  228. .IP \[bu] 2
  229. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  230. tool, supported tctis and exit.
  231. .IP \[bu] 2
  232. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  233. tool prints to the console during its execution.
  234. When using this option the file and line number are printed.
  235. .IP \[bu] 2
  236. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  237. .IP \[bu] 2
  238. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  239. errata fixups.
  240. Useful if an errata fixup needs to be applied to commands sent to the
  241. TPM.
  242. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  243. information many users may expect.
  244. .SH TCTI Configuration
  245. .PP
  246. The TCTI or "Transmission Interface" is the communication mechanism with
  247. the TPM.
  248. TCTIs can be changed for communication with TPMs across different
  249. mediums.
  250. .PP
  251. To control the TCTI, the tools respect:
  252. .IP "1." 3
  253. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  254. .IP "2." 3
  255. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  256. .PP
  257. \f[B]Note:\f[] The command line option always overrides the environment
  258. variable.
  259. .PP
  260. The current known TCTIs are:
  261. .IP \[bu] 2
  262. tabrmd \- The resource manager, called
  263. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  264. Note that tabrmd and abrmd as a tcti name are synonymous.
  265. .IP \[bu] 2
  266. mssim \- Typically used for communicating to the TPM software simulator.
  267. .IP \[bu] 2
  268. device \- Used when talking directly to a TPM device file.
  269. .IP \[bu] 2
  270. none \- Do not initalize a connection with the TPM.
  271. Some tools allow for off\-tpm options and thus support not using a TCTI.
  272. Tools that do not support it will error when attempted to be used
  273. without a TCTI connection.
  274. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  275. the exact text of "none".
  276. .PP
  277. The arguments to either the command line option or the environment
  278. variable are in the form:
  279. .PP
  280. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  281. .PP
  282. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  283. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  284. that portion respectively.
  285. .SS TCTI Defaults
  286. .PP
  287. When a TCTI is not specified, the default TCTI is searched for using
  288. \f[I]dlopen(3)\f[] semantics.
  289. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  290. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  291. FOUND\f[].
  292. You can query what TCTI will be chosen as the default by using the
  293. \f[B]\-v\f[] option to print the version information.
  294. The "default\-tcti" key\-value pair will indicate which of the
  295. aforementioned TCTIs is the default.
  296. .SS Custom TCTIs
  297. .PP
  298. Any TCTI that implements the dynamic TCTI interface can be loaded.
  299. The tools internally use \f[I]dlopen(3)\f[], and the raw
  300. \f[I]tcti\-name\f[] value is used for the lookup.
  301. Thus, this could be a path to the shared library, or a library name as
  302. understood by \f[I]dlopen(3)\f[] semantics.
  303. .SH TCTI OPTIONS
  304. .PP
  305. This collection of options are used to configure the various known TCTI
  306. modules available:
  307. .IP \[bu] 2
  308. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  309. use by the device TCTI can be specified.
  310. The default is \f[I]/dev/tpm0\f[].
  311. .RS 2
  312. .PP
  313. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  314. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  315. .RE
  316. .IP \[bu] 2
  317. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  318. port number used by the simulator can be specified.
  319. The default are 127.0.0.1 and 2321.
  320. .RS 2
  321. .PP
  322. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  323. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  324. .RE
  325. .IP \[bu] 2
  326. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  327. series of simple key value pairs separated by a \[aq],\[aq] character.
  328. Each key and value string are separated by a \[aq]=\[aq] character.
  329. .RS 2
  330. .IP \[bu] 2
  331. TCTI abrmd supports two keys:
  332. .RS 2
  333. .IP "1." 3
  334. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  335. string).
  336. .IP "2." 3
  337. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  338. \[aq]session\[aq] and \[aq]system\[aq].
  339. .RE
  340. .PP
  341. Specify the tabrmd tcti name and a config string of
  342. \f[C]bus_name=com.example.FooBar\f[]:
  343. .PP
  344. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  345. .PP
  346. Specify the default (abrmd) tcti and a config string of
  347. \f[C]bus_type=session\f[]:
  348. .PP
  349. \f[C]\\\-\-tcti:bus_type=session\f[]
  350. .PP
  351. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  352. the various known TCTI modules.
  353. .RE
  354. .SH EXAMPLES
  355. .SS Set the clock
  356. .PP
  357. Slow the clock one medium increment using the owner password.
  358. .IP
  359. .nf
  360. \f[C]
  361. tpm2_clockrateadjust\ \-p\ ownerpw\ ss
  362. \f[]
  363. .fi
  364. .PP
  365. Speed up the clock one course increment using the platform password.
  366. .IP
  367. .nf
  368. \f[C]
  369. tpm2_clockrateadjust\ \-c\ p\ \-p\ platformpw\ fff
  370. \f[]
  371. .fi
  372. .SH Returns
  373. .PP
  374. Tools can return any of the following codes:
  375. .IP \[bu] 2
  376. 0 \- Success.
  377. .IP \[bu] 2
  378. 1 \- General non\-specific error.
  379. .IP \[bu] 2
  380. 2 \- Options handling error.
  381. .IP \[bu] 2
  382. 3 \- Authentication error.
  383. .IP \[bu] 2
  384. 4 \- TCTI related error.
  385. .IP \[bu] 2
  386. 5 \- Non supported scheme.
  387. Applicable to tpm2_testparams.
  388. .SH BUGS
  389. .PP
  390. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  391. .SH HELP
  392. .PP
  393. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)