tpm2_policyor.1 9.3 KB

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