tpm2_policyduplicationselect.1 8.6 KB

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