tpm2_nvundefine.1 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_nvundefine" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_nvundefine\f[](1) \- Delete a Non\-Volatile (NV) index.
  8. .SH SYNOPSIS
  9. .PP
  10. \f[B]tpm2_nvundefine\f[] [\f[I]OPTIONS\f[]] [\f[I]ARGUMENT\f[]]
  11. .SH DESCRIPTION
  12. .PP
  13. \f[B]tpm2_nvundefine\f[](1) \- Deletes a Non\-Volatile (NV) index that
  14. was previously defined with \f[B]tpm2_nvdefine\f[](1).
  15. The index is specified as an argument.
  16. It can be specified as raw handle or an offset value to the nv handle
  17. range "TPM2_HR_NV_INDEX".
  18. .PP
  19. The tool is also capable of deleting NV indices with attribute
  20. \f[C]TPMA_NV_POLICY_DELETE\f[], and the tool uses this attribute for the
  21. default hierarchy to select when \f[C]\-C\f[] is missing.
  22. The default value for \f[C]\-C\f[] is the "owner" hierarchy when
  23. \f[C]TPMA_NV_POLICY_DELETE\f[] is clear and "platform" when
  24. \f[C]TPMA_NV_POLICY_DELETE\f[] is set.
  25. .SH OPTIONS
  26. .IP \[bu] 2
  27. \f[B]\-C\f[], \f[B]\-\-hierarchy\f[]=\f[I]OBJECT\f[]:
  28. .RS 2
  29. Specifies the hierarchy used to authorize.
  30. Supported options are:
  31. .IP \[bu] 2
  32. \f[B]o\f[] for \f[B]TPM_RH_OWNER\f[]
  33. .IP \[bu] 2
  34. \f[B]p\f[] for \f[B]TPM_RH_PLATFORM\f[]
  35. .IP \[bu] 2
  36. \f[B]\f[C]<num>\f[]\f[] where a hierarchy handle may be specified.
  37. .RE
  38. .IP \[bu] 2
  39. \f[B]\-P\f[], \f[B]\-\-auth\f[]=\f[I]AUTH\f[]:
  40. .RS 2
  41. .PP
  42. Specifies the authorization value for the hierarchy.
  43. .RE
  44. .IP \[bu] 2
  45. \f[B]\-S\f[], \f[B]\-\-session\f[]=\f[I]POLICY_SESSION\f[]:
  46. .RS 2
  47. .PP
  48. Specify a policy session to use when the NV index has attribute
  49. \f[C]TPMA_NV_POLICY_DELETE\f[] set.
  50. .RE
  51. .IP \[bu] 2
  52. \f[B]\-\-cphash\f[]=\f[I]FILE\f[]
  53. .RS 2
  54. .PP
  55. File path to record the hash of the command parameters.
  56. This is commonly termed as cpHash.
  57. NOTE: When this option is selected, The tool will not actually execute
  58. the command, it simply returns a cpHash.
  59. .RE
  60. .IP \[bu] 2
  61. \f[B]ARGUMENT\f[] the command line argument specifies the NV index or
  62. offset number.
  63. .SS References
  64. .SH Context Object Format
  65. .PP
  66. The type of a context object, whether it is a handle or file name, is
  67. determined according to the following logic \f[I]in\-order\f[]:
  68. .IP \[bu] 2
  69. If the argument is a file path, then the file is loaded as a restored
  70. TPM transient object.
  71. .IP \[bu] 2
  72. If the argument is a \f[I]prefix\f[] match on one of:
  73. .RS 2
  74. .IP \[bu] 2
  75. owner: the owner hierarchy
  76. .IP \[bu] 2
  77. platform: the platform hierarchy
  78. .IP \[bu] 2
  79. endorsement: the endorsement hierarchy
  80. .IP \[bu] 2
  81. lockout: the lockout control persistent object
  82. .RE
  83. .IP \[bu] 2
  84. If the argument argument can be loaded as a number it will be treat as a
  85. handle, e.g.
  86. 0x81010013 and used directly.\f[I]OBJECT\f[].
  87. .SH Authorization Formatting
  88. .PP
  89. Authorization for use of an object in TPM2.0 can come in 3 different
  90. forms: 1.
  91. Password 2.
  92. HMAC 3.
  93. Sessions
  94. .PP
  95. \f[B]NOTE:\f[] "Authorizations default to the \f[B]EMPTY PASSWORD\f[]
  96. when not specified".
  97. .SS Passwords
  98. .PP
  99. Passwords are interpreted in the following forms below using prefix
  100. identifiers.
  101. .PP
  102. \f[B]Note\f[]: By default passwords are assumed to be in the string form
  103. when they do not have a prefix.
  104. .SS String
  105. .PP
  106. A string password, specified by prefix "str:" or it\[aq]s absence (raw
  107. string without prefix) is not interpreted, and is directly used for
  108. authorization.
  109. .SS Examples
  110. .IP
  111. .nf
  112. \f[C]
  113. foobar
  114. str:foobar
  115. \f[]
  116. .fi
  117. .SS Hex\-string
  118. .PP
  119. A hex\-string password, specified by prefix "hex:" is converted from a
  120. hexidecimal form into a byte array form, thus allowing passwords with
  121. non\-printable and/or terminal un\-friendly characters.
  122. .SS Example
  123. .IP
  124. .nf
  125. \f[C]
  126. hex:0x1122334455667788
  127. \f[]
  128. .fi
  129. .SS File
  130. .PP
  131. A file based password, specified be prefix "file:" should be the path of
  132. a file containing the password to be read by the tool or a "\-" to use
  133. stdin.
  134. Storing passwords in files prevents information leakage, passwords
  135. passed as options can be read from the process list or common shell
  136. history features.
  137. .SS Examples
  138. .IP
  139. .nf
  140. \f[C]
  141. #\ to\ use\ stdin\ and\ be\ prompted
  142. file:\-
  143. #\ to\ use\ a\ file\ from\ a\ path
  144. file:path/to/password/file
  145. #\ to\ echo\ a\ password\ via\ stdin:
  146. echo\ foobar\ |\ tpm2_tool\ \-p\ file:\-
  147. #\ to\ use\ a\ bash\ here\-string\ via\ stdin:
  148. tpm2_tool\ \-p\ file:\-\ <<<\ foobar
  149. \f[]
  150. .fi
  151. .SS Sessions
  152. .PP
  153. When using a policy session to authorize the use of an object, prefix
  154. the option argument with the \f[I]session\f[] keyword.
  155. Then indicate a path to a session file that was created with
  156. tpm2_startauthsession(1).
  157. Optionally, if the session requires an auth value to be sent with the
  158. session handle (eg policy password), then append a + and a string as
  159. described in the \f[B]Passwords\f[] section.
  160. .SS Examples
  161. .PP
  162. To use a session context file called \f[I]session.ctx\f[].
  163. .IP
  164. .nf
  165. \f[C]
  166. session:session.ctx
  167. \f[]
  168. .fi
  169. .PP
  170. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  171. send the authvalue mypassword.
  172. .IP
  173. .nf
  174. \f[C]
  175. session:session.ctx+mypassword
  176. \f[]
  177. .fi
  178. .PP
  179. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  180. send the \f[I]HEX\f[] authvalue 0x11223344.
  181. .IP
  182. .nf
  183. \f[C]
  184. session:session.ctx+hex:11223344
  185. \f[]
  186. .fi
  187. .SS PCR Authorizations
  188. .PP
  189. You can satisfy a PCR policy using the "pcr:" prefix and the PCR
  190. minilanguage.
  191. The PCR minilanguage is as follows:
  192. \f[C]<pcr\-spec>=<raw\-pcr\-file>\f[]
  193. .PP
  194. The PCR spec is documented in in the section "PCR bank specifiers".
  195. .PP
  196. The \f[C]raw\-pcr\-file\f[] is an \f[B]optional\f[] the output of the
  197. raw PCR contents as returned by \f[I]tpm2_pcrread(1)\f[].
  198. .PP
  199. PCR bank specifiers (common/pcr.md)
  200. .SS Examples
  201. .PP
  202. To satisfy a PCR policy of sha256 on banks 0, 1, 2 and 3 use a specifier
  203. of:
  204. .IP
  205. .nf
  206. \f[C]
  207. pcr:sha256:0,1,2,3
  208. \f[]
  209. .fi
  210. .PP
  211. specifying \f[I]AUTH\f[].
  212. .SH COMMON OPTIONS
  213. .PP
  214. This collection of options are common to many programs and provide
  215. information that many users may expect.
  216. .IP \[bu] 2
  217. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  218. manpage.
  219. By default, it attempts to invoke the manpager for the tool, however, on
  220. failure will output a short tool summary.
  221. This is the same behavior if the "man" option argument is specified,
  222. however if explicit "man" is requested, the tool will provide errors
  223. from man on stderr.
  224. If the "no\-man" option if specified, or the manpager fails, the short
  225. options will be output to stdout.
  226. .RS 2
  227. .PP
  228. To successfully use the manpages feature requires the manpages to be
  229. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  230. .RE
  231. .IP \[bu] 2
  232. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  233. tool, supported tctis and exit.
  234. .IP \[bu] 2
  235. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  236. tool prints to the console during its execution.
  237. When using this option the file and line number are printed.
  238. .IP \[bu] 2
  239. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  240. .IP \[bu] 2
  241. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  242. errata fixups.
  243. Useful if an errata fixup needs to be applied to commands sent to the
  244. TPM.
  245. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  246. information many users may expect.
  247. .SH TCTI Configuration
  248. .PP
  249. The TCTI or "Transmission Interface" is the communication mechanism with
  250. the TPM.
  251. TCTIs can be changed for communication with TPMs across different
  252. mediums.
  253. .PP
  254. To control the TCTI, the tools respect:
  255. .IP "1." 3
  256. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  257. .IP "2." 3
  258. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  259. .PP
  260. \f[B]Note:\f[] The command line option always overrides the environment
  261. variable.
  262. .PP
  263. The current known TCTIs are:
  264. .IP \[bu] 2
  265. tabrmd \- The resource manager, called
  266. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  267. Note that tabrmd and abrmd as a tcti name are synonymous.
  268. .IP \[bu] 2
  269. mssim \- Typically used for communicating to the TPM software simulator.
  270. .IP \[bu] 2
  271. device \- Used when talking directly to a TPM device file.
  272. .IP \[bu] 2
  273. none \- Do not initalize a connection with the TPM.
  274. Some tools allow for off\-tpm options and thus support not using a TCTI.
  275. Tools that do not support it will error when attempted to be used
  276. without a TCTI connection.
  277. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  278. the exact text of "none".
  279. .PP
  280. The arguments to either the command line option or the environment
  281. variable are in the form:
  282. .PP
  283. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  284. .PP
  285. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  286. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  287. that portion respectively.
  288. .SS TCTI Defaults
  289. .PP
  290. When a TCTI is not specified, the default TCTI is searched for using
  291. \f[I]dlopen(3)\f[] semantics.
  292. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  293. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  294. FOUND\f[].
  295. You can query what TCTI will be chosen as the default by using the
  296. \f[B]\-v\f[] option to print the version information.
  297. The "default\-tcti" key\-value pair will indicate which of the
  298. aforementioned TCTIs is the default.
  299. .SS Custom TCTIs
  300. .PP
  301. Any TCTI that implements the dynamic TCTI interface can be loaded.
  302. The tools internally use \f[I]dlopen(3)\f[], and the raw
  303. \f[I]tcti\-name\f[] value is used for the lookup.
  304. Thus, this could be a path to the shared library, or a library name as
  305. understood by \f[I]dlopen(3)\f[] semantics.
  306. .SH TCTI OPTIONS
  307. .PP
  308. This collection of options are used to configure the various known TCTI
  309. modules available:
  310. .IP \[bu] 2
  311. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  312. use by the device TCTI can be specified.
  313. The default is \f[I]/dev/tpm0\f[].
  314. .RS 2
  315. .PP
  316. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  317. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  318. .RE
  319. .IP \[bu] 2
  320. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  321. port number used by the simulator can be specified.
  322. The default are 127.0.0.1 and 2321.
  323. .RS 2
  324. .PP
  325. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  326. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  327. .RE
  328. .IP \[bu] 2
  329. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  330. series of simple key value pairs separated by a \[aq],\[aq] character.
  331. Each key and value string are separated by a \[aq]=\[aq] character.
  332. .RS 2
  333. .IP \[bu] 2
  334. TCTI abrmd supports two keys:
  335. .RS 2
  336. .IP "1." 3
  337. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  338. string).
  339. .IP "2." 3
  340. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  341. \[aq]session\[aq] and \[aq]system\[aq].
  342. .RE
  343. .PP
  344. Specify the tabrmd tcti name and a config string of
  345. \f[C]bus_name=com.example.FooBar\f[]:
  346. .PP
  347. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  348. .PP
  349. Specify the default (abrmd) tcti and a config string of
  350. \f[C]bus_type=session\f[]:
  351. .PP
  352. \f[C]\\\-\-tcti:bus_type=session\f[]
  353. .PP
  354. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  355. the various known TCTI modules.
  356. .RE
  357. .SH EXAMPLES
  358. .SS Define an ordinary NV index and delete it
  359. .IP
  360. .nf
  361. \f[C]
  362. tpm2_nvdefine\ 1
  363. tpm2_nvundefine\ 1
  364. \f[]
  365. .fi
  366. .SS Define an ordinary NV index with attribute
  367. \f[C]TPMA_NV_POLICY_DELETE\f[] and delete it
  368. .IP
  369. .nf
  370. \f[C]
  371. tpm2_startauthsession\ \-S\ s.ctx
  372. tpm2_policyauthvalue\ \-S\ s.ctx
  373. tpm2_policycommandcode\ \-S\ s.ctx\ \-L\ policy.dat\ TPM2_CC_NV_UndefineSpaceSpecial
  374. tpm2_nvdefine\ \-C\ p\ \-s\ 32\ \\
  375. \ \ \-a\ "ppread|ppwrite|authread|authwrite|platformcreate|policydelete|write_stclear|read_stclear"\ \\
  376. \ \ \-L\ policy.dat\ 1
  377. tpm2_flushcontext\ s.ctx
  378. tpm2_startauthsession\ \-\-policy\-session\ \-S\ s.ctx
  379. tpm2_policyauthvalue\ \-S\ s.ctx
  380. tpm2_policycommandcode\ \-S\ s.ctx\ TPM2_CC_NV_UndefineSpaceSpecial
  381. tpm2_nvundefine\ \-S\ s.ctx\ 1
  382. \f[]
  383. .fi
  384. .SH Returns
  385. .PP
  386. Tools can return any of the following codes:
  387. .IP \[bu] 2
  388. 0 \- Success.
  389. .IP \[bu] 2
  390. 1 \- General non\-specific error.
  391. .IP \[bu] 2
  392. 2 \- Options handling error.
  393. .IP \[bu] 2
  394. 3 \- Authentication error.
  395. .IP \[bu] 2
  396. 4 \- TCTI related error.
  397. .IP \[bu] 2
  398. 5 \- Non supported scheme.
  399. Applicable to tpm2_testparams.
  400. .SH BUGS
  401. .PP
  402. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  403. .SH HELP
  404. .PP
  405. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)