tpm2_policylocality.1 8.8 KB

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