tpm2_policyauthvalue.1 8.2 KB

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