tpm2_policypassword.1 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_policypassword" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_policypassword\f[](1) \- Enables binding a policy to the
  8. authorization value of the authorized TPM object.
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]tpm2_policypassword\f[] [\f[I]OPTIONS\f[]]
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]tpm2_policypassword\f[](1) \- Enables a policy that requires the
  15. object\[aq]s authentication passphrase be provided.
  16. This is equivalent to authenticating using the object passphrase in
  17. plaintext, only this enforces it as a policy.
  18. It provides a mechanism to allow for password authentication when an
  19. object only allows policy based authorization, ie object attribute
  20. "userwithauth" is 0.
  21. .SH OPTIONS
  22. .IP \[bu] 2
  23. \f[B]\-L\f[], \f[B]\-\-policy\f[]=\f[I]FILE\f[]:
  24. .RS 2
  25. .PP
  26. File to save the compounded policy digest.
  27. .RE
  28. .IP \[bu] 2
  29. \f[B]\-S\f[], \f[B]\-\-session\f[]=\f[I]FILE\f[]:
  30. .RS 2
  31. .PP
  32. The policy session file generated via the \f[B]\-S\f[] option to
  33. \f[B]tpm2_startauthsession\f[](1).
  34. .RE
  35. .SS References
  36. .SH COMMON OPTIONS
  37. .PP
  38. This collection of options are common to many programs and provide
  39. information that many users may expect.
  40. .IP \[bu] 2
  41. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  42. manpage.
  43. By default, it attempts to invoke the manpager for the tool, however, on
  44. failure will output a short tool summary.
  45. This is the same behavior if the "man" option argument is specified,
  46. however if explicit "man" is requested, the tool will provide errors
  47. from man on stderr.
  48. If the "no\-man" option if specified, or the manpager fails, the short
  49. options will be output to stdout.
  50. .RS 2
  51. .PP
  52. To successfully use the manpages feature requires the manpages to be
  53. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  54. .RE
  55. .IP \[bu] 2
  56. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  57. tool, supported tctis and exit.
  58. .IP \[bu] 2
  59. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  60. tool prints to the console during its execution.
  61. When using this option the file and line number are printed.
  62. .IP \[bu] 2
  63. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  64. .IP \[bu] 2
  65. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  66. errata fixups.
  67. Useful if an errata fixup needs to be applied to commands sent to the
  68. TPM.
  69. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  70. information many users may expect.
  71. .SH TCTI Configuration
  72. .PP
  73. The TCTI or "Transmission Interface" is the communication mechanism with
  74. the TPM.
  75. TCTIs can be changed for communication with TPMs across different
  76. mediums.
  77. .PP
  78. To control the TCTI, the tools respect:
  79. .IP "1." 3
  80. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  81. .IP "2." 3
  82. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  83. .PP
  84. \f[B]Note:\f[] The command line option always overrides the environment
  85. variable.
  86. .PP
  87. The current known TCTIs are:
  88. .IP \[bu] 2
  89. tabrmd \- The resource manager, called
  90. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  91. Note that tabrmd and abrmd as a tcti name are synonymous.
  92. .IP \[bu] 2
  93. mssim \- Typically used for communicating to the TPM software simulator.
  94. .IP \[bu] 2
  95. device \- Used when talking directly to a TPM device file.
  96. .IP \[bu] 2
  97. none \- Do not initalize a connection with the TPM.
  98. Some tools allow for off\-tpm options and thus support not using a TCTI.
  99. Tools that do not support it will error when attempted to be used
  100. without a TCTI connection.
  101. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  102. the exact text of "none".
  103. .PP
  104. The arguments to either the command line option or the environment
  105. variable are in the form:
  106. .PP
  107. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  108. .PP
  109. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  110. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  111. that portion respectively.
  112. .SS TCTI Defaults
  113. .PP
  114. When a TCTI is not specified, the default TCTI is searched for using
  115. \f[I]dlopen(3)\f[] semantics.
  116. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  117. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  118. FOUND\f[].
  119. You can query what TCTI will be chosen as the default by using the
  120. \f[B]\-v\f[] option to print the version information.
  121. The "default\-tcti" key\-value pair will indicate which of the
  122. aforementioned TCTIs is the default.
  123. .SS Custom TCTIs
  124. .PP
  125. Any TCTI that implements the dynamic TCTI interface can be loaded.
  126. The tools internally use \f[I]dlopen(3)\f[], and the raw
  127. \f[I]tcti\-name\f[] value is used for the lookup.
  128. Thus, this could be a path to the shared library, or a library name as
  129. understood by \f[I]dlopen(3)\f[] semantics.
  130. .SH TCTI OPTIONS
  131. .PP
  132. This collection of options are used to configure the various known TCTI
  133. modules available:
  134. .IP \[bu] 2
  135. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  136. use by the device TCTI can be specified.
  137. The default is \f[I]/dev/tpm0\f[].
  138. .RS 2
  139. .PP
  140. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  141. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  142. .RE
  143. .IP \[bu] 2
  144. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  145. port number used by the simulator can be specified.
  146. The default are 127.0.0.1 and 2321.
  147. .RS 2
  148. .PP
  149. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  150. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  151. .RE
  152. .IP \[bu] 2
  153. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  154. series of simple key value pairs separated by a \[aq],\[aq] character.
  155. Each key and value string are separated by a \[aq]=\[aq] character.
  156. .RS 2
  157. .IP \[bu] 2
  158. TCTI abrmd supports two keys:
  159. .RS 2
  160. .IP "1." 3
  161. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  162. string).
  163. .IP "2." 3
  164. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  165. \[aq]session\[aq] and \[aq]system\[aq].
  166. .RE
  167. .PP
  168. Specify the tabrmd tcti name and a config string of
  169. \f[C]bus_name=com.example.FooBar\f[]:
  170. .PP
  171. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  172. .PP
  173. Specify the default (abrmd) tcti and a config string of
  174. \f[C]bus_type=session\f[]:
  175. .PP
  176. \f[C]\\\-\-tcti:bus_type=session\f[]
  177. .PP
  178. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  179. the various known TCTI modules.
  180. .RE
  181. .SH EXAMPLES
  182. .PP
  183. We want to authenticate using the TPM objects plaintext authentication
  184. value.
  185. While we could authenticate with an ephemeral password session, in this
  186. example we will authenticate with the plaintext passphrase in a policy
  187. session instead using the \f[B]tpm2_policypassword\f[](1) tool.
  188. .SS Create the password policy
  189. .IP
  190. .nf
  191. \f[C]
  192. tpm2_startauthsession\ \-S\ session.dat
  193. tpm2_policypassword\ \-S\ session.dat\ \-L\ policy.dat
  194. tpm2_flushcontext\ session.dat
  195. \f[]
  196. .fi
  197. .SS Create the object with a passphrase and the password policy
  198. .IP
  199. .nf
  200. \f[C]
  201. tpm2_createprimary\ \-C\ o\ \-c\ prim.ctx
  202. tpm2_create\ \-g\ sha256\ \-G\ aes\ \-u\ key.pub\ \-r\ key.priv\ \-C\ prim.ctx\ \-L\ policy.dat\ \\
  203. \ \ \-p\ testpswd
  204. \f[]
  205. .fi
  206. .SS Authenticate with plaintext passphrase input
  207. .IP
  208. .nf
  209. \f[C]
  210. tpm2_load\ \-C\ prim.ctx\ \-u\ key.pub\ \-r\ key.priv\ \-n\ key.name\ \-c\ key.ctx
  211. echo\ "plaintext"\ >\ plain.txt
  212. tpm2_encryptdecrypt\ \-c\ key.ctx\ \-o\ encrypt.out\ plain.txt\ \-p\ testpswd\ plain.txt
  213. \f[]
  214. .fi
  215. .SS Authenticate with password and the policy
  216. .IP
  217. .nf
  218. \f[C]
  219. tpm2_startauthsession\ \\\-\-policy\-session\ \-S\ session.dat
  220. tpm2_policypassword\ \-S\ session.dat\ \-L\ policy.dat
  221. tpm2_encryptdecrypt\ \-c\ key.ctx\ \-o\ encrypt.out\ \\
  222. \ \ \-p\ session:session.dat+testpswd\ plain.txt
  223. tpm2_flushcontext\ session.dat
  224. \f[]
  225. .fi
  226. .SH Returns
  227. .PP
  228. Tools can return any of the following codes:
  229. .IP \[bu] 2
  230. 0 \- Success.
  231. .IP \[bu] 2
  232. 1 \- General non\-specific error.
  233. .IP \[bu] 2
  234. 2 \- Options handling error.
  235. .IP \[bu] 2
  236. 3 \- Authentication error.
  237. .IP \[bu] 2
  238. 4 \- TCTI related error.
  239. .IP \[bu] 2
  240. 5 \- Non supported scheme.
  241. Applicable to tpm2_testparams.
  242. .SH Limitations
  243. .PP
  244. It expects a session to be already established via
  245. \f[B]tpm2_startauthsession\f[](1) and requires one of the following:
  246. .IP \[bu] 2
  247. direct device access
  248. .IP \[bu] 2
  249. extended session support with \f[B]tpm2\-abrmd\f[].
  250. .PP
  251. Without it, most resource managers \f[B]will not\f[] save session state
  252. between command invocations.
  253. .SH BUGS
  254. .PP
  255. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  256. .SH HELP
  257. .PP
  258. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)