ifapi_policy.3 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. .TH "ifapi_policy" 3 "Fri Oct 7 2022" "Version 3.2.0" "tpm2-tss" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. ifapi_policy
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .SS "Functions"
  10. .in +1c
  11. .ti -1c
  12. .RI "TSS2_RC \fBifapi_calculate_tree\fP (\fBFAPI_CONTEXT\fP *context, const char *policyPath, \fBTPMS_POLICY\fP *policy, TPMI_ALG_HASH hash_alg, size_t *digest_idx, size_t *hash_size)"
  13. .br
  14. .ti -1c
  15. .RI "TSS2_RC \fBifapi_calculate_policy\fP (\fBTPML_POLICYELEMENTS\fP *policy, TPML_DIGEST_VALUES *policyDigests, TPMI_ALG_HASH hash_alg, size_t hash_size, size_t digest_idx)"
  16. .br
  17. .ti -1c
  18. .RI "TSS2_RC \fBifapi_calculate_policy_authorize\fP (\fBTPMS_POLICYAUTHORIZE\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  19. .br
  20. .ti -1c
  21. .RI "TSS2_RC \fBifapi_calculate_policy_authorize_nv\fP (\fBTPMS_POLICYAUTHORIZENV\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  22. .br
  23. .ti -1c
  24. .RI "TSS2_RC \fBifapi_calculate_policy_command_code\fP (\fBTPMS_POLICYCOMMANDCODE\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  25. .br
  26. .ti -1c
  27. .RI "TSS2_RC \fBifapi_calculate_policy_counter_timer\fP (\fBTPMS_POLICYCOUNTERTIMER\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  28. .br
  29. .ti -1c
  30. .RI "TSS2_RC \fBifapi_calculate_policy_cp_hash\fP (\fBTPMS_POLICYCPHASH\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  31. .br
  32. .ti -1c
  33. .RI "TSS2_RC \fBifapi_calculate_policy_digest_hash\fP (TPM2B_DIGEST *digest, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg, TPM2_CC command_code)"
  34. .br
  35. .ti -1c
  36. .RI "TSS2_RC \fBifapi_calculate_policy_duplicate\fP (\fBTPMS_POLICYDUPLICATIONSELECT\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  37. .br
  38. .ti -1c
  39. .RI "TSS2_RC \fBifapi_calculate_policy_locality\fP (\fBTPMS_POLICYLOCALITY\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  40. .br
  41. .ti -1c
  42. .RI "TSS2_RC \fBifapi_calculate_policy_name_hash\fP (\fBTPMS_POLICYNAMEHASH\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  43. .br
  44. .ti -1c
  45. .RI "TSS2_RC \fBifapi_calculate_policy_nv\fP (\fBTPMS_POLICYNV\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  46. .br
  47. .ti -1c
  48. .RI "TSS2_RC \fBifapi_calculate_policy_nv_written\fP (\fBTPMS_POLICYNVWRITTEN\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  49. .br
  50. .ti -1c
  51. .RI "TSS2_RC \fBifapi_calculate_policy_or\fP (\fBTPMS_POLICYOR\fP *policyOr, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH hash_alg, size_t hash_size, size_t digest_idx)"
  52. .br
  53. .ti -1c
  54. .RI "TSS2_RC \fBifapi_calculate_policy_secret\fP (\fBTPMS_POLICYSECRET\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  55. .br
  56. .ti -1c
  57. .RI "TSS2_RC \fBifapi_calculate_policy_signed\fP (\fBTPMS_POLICYSIGNED\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  58. .br
  59. .ti -1c
  60. .RI "TSS2_RC \fBifapi_calculate_simple_policy\fP (TPM2_CC command_code1, TPM2_CC command_code2, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  61. .br
  62. .ti -1c
  63. .RI "TSS2_RC \fBifapi_compute_policy_pcr\fP (\fBTPMS_POLICYPCR\fP *policy, TPML_DIGEST_VALUES *current_digest, TPMI_ALG_HASH current_hash_alg)"
  64. .br
  65. .in -1c
  66. .SH "Detailed Description"
  67. .PP
  68. Provides functions for policy calculation (without TPM)\&.
  69. .SH "Function Documentation"
  70. .PP
  71. .SS "TSS2_RC ifapi_calculate_policy (\fBTPML_POLICYELEMENTS\fP * policy, TPML_DIGEST_VALUES * policyDigests, TPMI_ALG_HASH hash_alg, size_t hash_size, size_t digest_idx)"
  72. Compute policy digest for a list of policies\&.
  73. .PP
  74. Every policy in the list will update the previous policy\&. Thus the final policy digest will describe the sequential execution of the policy list\&.
  75. .PP
  76. \fBParameters:\fP
  77. .RS 4
  78. \fIpolicy\fP The policy with the policy list\&.
  79. .br
  80. \fIpolicyDigests\fP The digest list which has to be updated\&.
  81. .br
  82. \fIhash_alg\fP The hash algorithm used for the policy computation\&.
  83. .br
  84. \fIhash_size\fP The size of the policy digest\&.
  85. .br
  86. \fIdigest_idx\fP The index of the current policy in the passed digest list\&.
  87. .RE
  88. .PP
  89. \fBReturn values:\fP
  90. .RS 4
  91. \fITSS2_RC_SUCCESS\fP on success\&.
  92. .br
  93. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  94. .br
  95. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  96. .br
  97. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  98. .br
  99. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  100. .RE
  101. .PP
  102. .SS "TSS2_RC ifapi_calculate_policy_authorize (\fBTPMS_POLICYAUTHORIZE\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  103. Calculate a policy digest for a placeholder policy\&.
  104. .PP
  105. The placeholder policy can be extended during execution by a signed policy, which can be verified by using the parameters of this placeholder policy\&. Based on the command code, the key name of the signing key and a policy reference the new policy digest is computed by the function calculate_policy_key_param()\&.
  106. .PP
  107. \fBParameters:\fP
  108. .RS 4
  109. \fIpolicy\fP The policy with the name of the public key and the policy reference\&.
  110. .br
  111. \fIcurrent_digest\fP The digest list which has to be updated\&.
  112. .br
  113. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  114. .RE
  115. .PP
  116. \fBReturn values:\fP
  117. .RS 4
  118. \fITSS2_RC_SUCCESS\fP on success\&.
  119. .br
  120. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  121. .br
  122. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  123. .br
  124. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  125. .br
  126. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  127. .RE
  128. .PP
  129. .SS "TSS2_RC ifapi_calculate_policy_authorize_nv (\fBTPMS_POLICYAUTHORIZENV\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  130. Calculate a policy digest for a policy stored in an approved NV index\&.
  131. .PP
  132. Based on the command code, and the computed NV name the new policy digest is computed by the function calculate_policy_key_param()\&.
  133. .PP
  134. \fBParameters:\fP
  135. .RS 4
  136. \fIpolicy\fP The policy with the public information of the NV index\&.
  137. .br
  138. \fIcurrent_digest\fP The digest list which has to be updated\&.
  139. .br
  140. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  141. .RE
  142. .PP
  143. \fBReturn values:\fP
  144. .RS 4
  145. \fITSS2_RC_SUCCESS\fP on success\&.
  146. .br
  147. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  148. .br
  149. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  150. .br
  151. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  152. .br
  153. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  154. .RE
  155. .PP
  156. .SS "TSS2_RC ifapi_calculate_policy_command_code (\fBTPMS_POLICYCOMMANDCODE\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  157. Update policy command code with a command code defined in the policy\&.
  158. .PP
  159. For the update two command codes will be used\&. The command code of policy command code and the passed command code\&. The policy will be updated with the function \fBifapi_calculate_simple_policy()\fP
  160. .PP
  161. \fBParameters:\fP
  162. .RS 4
  163. \fIpolicy\fP The policy command code with the second command code\&.
  164. .br
  165. \fIcurrent_digest\fP The digest list which has to be updated\&.
  166. .br
  167. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  168. .RE
  169. .PP
  170. \fBReturn values:\fP
  171. .RS 4
  172. \fITSS2_RC_SUCCESS\fP on success\&.
  173. .br
  174. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  175. .br
  176. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  177. .br
  178. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  179. .br
  180. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  181. .RE
  182. .PP
  183. .SS "TSS2_RC ifapi_calculate_policy_counter_timer (\fBTPMS_POLICYCOUNTERTIMER\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  184. Calculate a policy for for comparing current TPM timers with the policy\&.
  185. .PP
  186. The timer value and the operation for comparison defined in the policy will bu used to update the policy digest\&. The offset which is supported by the TPM policy for FAPI will be 0\&.
  187. .PP
  188. \fBParameters:\fP
  189. .RS 4
  190. \fIpolicy\fP The policy with the timer value and the operation for comparison\&.
  191. .br
  192. \fIcurrent_digest\fP The digest list which has to be updated\&.
  193. .br
  194. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  195. .RE
  196. .PP
  197. \fBReturn values:\fP
  198. .RS 4
  199. \fITSS2_RC_SUCCESS\fP on success\&.
  200. .br
  201. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  202. .br
  203. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  204. .br
  205. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  206. .br
  207. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  208. .RE
  209. .PP
  210. .SS "TSS2_RC ifapi_calculate_policy_cp_hash (\fBTPMS_POLICYCPHASH\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  211. Compute policy bound to a specific command and command parameters\&.
  212. .PP
  213. The cp hash value and the command code will be updated by the function \fBifapi_calculate_policy_digest_hash()\fP\&.
  214. .PP
  215. \fBParameters:\fP
  216. .RS 4
  217. \fIpolicy\fP The policy with the cp hash value\&.
  218. .br
  219. \fIcurrent_digest\fP The digest list which has to be updated\&.
  220. .br
  221. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  222. .RE
  223. .PP
  224. \fBReturn values:\fP
  225. .RS 4
  226. \fITSS2_RC_SUCCESS\fP on success\&.
  227. .br
  228. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  229. .br
  230. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  231. .br
  232. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  233. .br
  234. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  235. .RE
  236. .PP
  237. .SS "TSS2_RC ifapi_calculate_policy_digest_hash (TPM2B_DIGEST * digest, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg, TPM2_CC command_code)"
  238. Compute policy if only a digest and a command code are needed for extension\&.
  239. .PP
  240. \fBParameters:\fP
  241. .RS 4
  242. \fIdigest\fP the digest which will be used for policy extension\&.
  243. .br
  244. \fIcurrent_digest\fP The digest list which has to be updated\&.
  245. .br
  246. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  247. .br
  248. \fIcommand_code\fP The compute of the command which did compute the digest\&.
  249. .RE
  250. .PP
  251. \fBReturn values:\fP
  252. .RS 4
  253. \fITSS2_RC_SUCCESS\fP on success\&.
  254. .br
  255. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  256. .br
  257. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  258. .br
  259. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  260. .br
  261. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  262. .RE
  263. .PP
  264. .SS "TSS2_RC ifapi_calculate_policy_duplicate (\fBTPMS_POLICYDUPLICATIONSELECT\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  265. Calculate a policy digest to allow duplication force a selected new parent\&.
  266. .PP
  267. Based on the command code, the name of the new parent, and the include object switch the new policy digest is computed\&.
  268. .PP
  269. \fBParameters:\fP
  270. .RS 4
  271. \fIpolicy\fP The policy with the new parent information\&.
  272. .br
  273. \fIcurrent_digest\fP The digest list which has to be updated\&.
  274. .br
  275. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  276. .RE
  277. .PP
  278. \fBReturn values:\fP
  279. .RS 4
  280. \fITSS2_RC_SUCCESS\fP on success\&.
  281. .br
  282. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  283. .br
  284. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  285. .br
  286. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  287. .br
  288. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  289. .RE
  290. .PP
  291. .SS "TSS2_RC ifapi_calculate_policy_locality (\fBTPMS_POLICYLOCALITY\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  292. Compute policy which limits authorization to a specific locality\&.
  293. .PP
  294. \fBParameters:\fP
  295. .RS 4
  296. \fIpolicy\fP The policy with the locality\&.
  297. .br
  298. \fIcurrent_digest\fP The digest list which has to be updated\&.
  299. .br
  300. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  301. .RE
  302. .PP
  303. \fBReturn values:\fP
  304. .RS 4
  305. \fITSS2_RC_SUCCESS\fP on success\&.
  306. .br
  307. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  308. .br
  309. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  310. .br
  311. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  312. .br
  313. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  314. .RE
  315. .PP
  316. .SS "TSS2_RC ifapi_calculate_policy_name_hash (\fBTPMS_POLICYNAMEHASH\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  317. Compute policy bound to a specific set of TPM entities\&.
  318. .PP
  319. The policy digest will be updated with the function \fBifapi_calculate_policy_digest_hash()\fP which will add the hash of the entity name list\&.
  320. .PP
  321. \fBParameters:\fP
  322. .RS 4
  323. \fIpolicy\fP The policy with the list of entity names\&.
  324. .br
  325. \fIcurrent_digest\fP The digest list which has to be updated\&.
  326. .br
  327. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  328. .RE
  329. .PP
  330. \fBReturn values:\fP
  331. .RS 4
  332. \fITSS2_RC_SUCCESS\fP on success\&.
  333. .br
  334. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  335. .br
  336. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  337. .br
  338. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  339. .br
  340. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  341. .RE
  342. .PP
  343. .SS "TSS2_RC ifapi_calculate_policy_nv (\fBTPMS_POLICYNV\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  344. Compute policy bound to the content of an NV index\&.
  345. .PP
  346. The value used for comparison, the compare operation and an offset for the NV index are part of the policy\&.
  347. .PP
  348. \fBParameters:\fP
  349. .RS 4
  350. \fIpolicy\fP The policy with the expected values used for comparison\&.
  351. .br
  352. \fIcurrent_digest\fP The digest list which has to be updated\&.
  353. .br
  354. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  355. .RE
  356. .PP
  357. \fBReturn values:\fP
  358. .RS 4
  359. \fITSS2_RC_SUCCESS\fP on success\&.
  360. .br
  361. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  362. .br
  363. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  364. .br
  365. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  366. .br
  367. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  368. .RE
  369. .PP
  370. .SS "TSS2_RC ifapi_calculate_policy_nv_written (\fBTPMS_POLICYNVWRITTEN\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  371. Compute policy bound to bound to the TPMA_NV_WRITTEN attributes\&.
  372. .PP
  373. The expected value of the NV written attribute is part of the policy\&.
  374. .PP
  375. \fBParameters:\fP
  376. .RS 4
  377. \fIpolicy\fP The policy with the expected attribute value\&.
  378. .br
  379. \fIcurrent_digest\fP The digest list which has to be updated\&.
  380. .br
  381. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  382. .RE
  383. .PP
  384. \fBReturn values:\fP
  385. .RS 4
  386. \fITSS2_RC_SUCCESS\fP on success\&.
  387. .br
  388. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  389. .br
  390. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  391. .br
  392. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  393. .br
  394. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  395. .RE
  396. .PP
  397. .SS "TSS2_RC ifapi_calculate_policy_or (\fBTPMS_POLICYOR\fP * policyOr, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH hash_alg, size_t hash_size, size_t digest_idx)"
  398. Compute a list of policies to enable authorization options\&.
  399. .PP
  400. First the policy digest will be computed for every branch\&. After that the policy digest will be reset to zero and extended by the list of computed policy digests of the branches\&.
  401. .PP
  402. \fBParameters:\fP
  403. .RS 4
  404. \fIpolicyOr\fP The policy with the possible policy branches\&.
  405. .br
  406. \fIcurrent_digest\fP The digest list which has to be updated\&.
  407. .br
  408. \fIhash_alg\fP The hash algorithm used for the policy computation\&.
  409. .br
  410. \fIhash_size\fP The size of the policy digest\&.
  411. .br
  412. \fIdigest_idx\fP The index of the current policy in the passed digest list\&.
  413. .RE
  414. .PP
  415. \fBReturn values:\fP
  416. .RS 4
  417. \fITSS2_RC_SUCCESS\fP on success\&.
  418. .br
  419. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  420. .br
  421. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  422. .br
  423. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  424. .br
  425. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  426. .RE
  427. .PP
  428. .SS "TSS2_RC ifapi_calculate_policy_secret (\fBTPMS_POLICYSECRET\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  429. Calculate a policy for adding secret-based authorization\&.
  430. .PP
  431. During execution proving the knowledge of the secrect auth value of a certain object is required\&. The name of this object and a policy reference is used for policy calculation\&. Based on the command code, the object name and a policy reference the new policy digest is computed by the function calculate_policy_key_param()\&.
  432. .PP
  433. \fBParameters:\fP
  434. .RS 4
  435. \fIpolicy\fP The policy with the object name of the object to be authorized and the policy reference\&.
  436. .br
  437. \fIcurrent_digest\fP The digest list which has to be updated\&.
  438. .br
  439. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  440. .RE
  441. .PP
  442. \fBReturn values:\fP
  443. .RS 4
  444. \fITSS2_RC_SUCCESS\fP on success\&.
  445. .br
  446. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  447. .br
  448. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  449. .br
  450. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  451. .br
  452. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  453. .RE
  454. .PP
  455. .SS "TSS2_RC ifapi_calculate_policy_signed (\fBTPMS_POLICYSIGNED\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  456. Calculate a policy digest for a signed policy\&.
  457. .PP
  458. Based on the command code, the public key, and the policy reference stored in the policy the new policy digest is computed by the function calculate_policy_key_param()\&.
  459. .PP
  460. \fBParameters:\fP
  461. .RS 4
  462. \fIpolicy\fP The policy with the public key and the policy reference\&.
  463. .br
  464. \fIcurrent_digest\fP The digest list which has to be updated\&.
  465. .br
  466. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  467. .RE
  468. .PP
  469. \fBReturn values:\fP
  470. .RS 4
  471. \fITSS2_RC_SUCCESS\fP on success\&.
  472. .br
  473. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  474. .br
  475. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  476. .br
  477. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  478. .br
  479. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  480. .RE
  481. .PP
  482. .SS "TSS2_RC ifapi_calculate_simple_policy (TPM2_CC command_code1, TPM2_CC command_code2, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  483. Update policy if only the command codes are used\&.
  484. .PP
  485. Some simple policies use onle one or two command codes for policy calculation\&.
  486. .PP
  487. \fBParameters:\fP
  488. .RS 4
  489. \fIcommand_code1\fP The first command code for policy extension\&. Can be NULL\&.
  490. .br
  491. \fIcommand_code2\fP The second command code for policy extension\&. Can be NULL\&.
  492. .br
  493. \fIcurrent_digest\fP The digest list which has to be updated\&.
  494. .br
  495. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  496. .RE
  497. .PP
  498. \fBReturn values:\fP
  499. .RS 4
  500. \fITSS2_RC_SUCCESS\fP on success\&.
  501. .br
  502. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  503. .br
  504. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  505. .br
  506. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  507. .br
  508. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  509. .RE
  510. .PP
  511. .SS "TSS2_RC ifapi_calculate_tree (\fBFAPI_CONTEXT\fP * context, const char * policyPath, \fBTPMS_POLICY\fP * policy, TPMI_ALG_HASH hash_alg, size_t * digest_idx, size_t * hash_size)"
  512. Compute policy digest for a policy tree\&.
  513. .PP
  514. A policy or a policy path can be passed\&. If a policy is passed the policy is computed directly from the policy otherwise the policy has to be retrieved from policy store to determine the policy\&.
  515. .PP
  516. \fBParameters:\fP
  517. .RS 4
  518. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  519. .br
  520. \fIpolicyPath\fP The policy path for policy store\&.
  521. .br
  522. \fIpolicy\fP The result of policy deserialization\&.
  523. .br
  524. \fIhash_alg\fP The used hash alg for policy digest computations\&.
  525. .br
  526. \fIdigest_idx\fP The index of the current digest\&. The policy digest can be computed for several hash algorithms the digets index is a reverence to the current digest values\&.
  527. .br
  528. \fIhash_size\fP The size of the current policy digest\&.
  529. .RE
  530. .PP
  531. \fBReturn values:\fP
  532. .RS 4
  533. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  534. .br
  535. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP If an internal error occurs, which is not covered by other return codes\&.
  536. .br
  537. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during policy calculation\&.
  538. .br
  539. \fITSS2_FAPI_RC_IO_ERROR\fP If an error occurs during access to the policy store\&.
  540. .br
  541. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP If an object needed for policy calculation was not found\&.
  542. .br
  543. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP If policy search for a certain policy digest was not successful\&.
  544. .br
  545. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  546. .br
  547. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  548. .br
  549. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  550. .br
  551. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  552. .br
  553. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  554. .br
  555. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  556. .br
  557. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  558. .RE
  559. .PP
  560. .SS "TSS2_RC ifapi_compute_policy_pcr (\fBTPMS_POLICYPCR\fP * policy, TPML_DIGEST_VALUES * current_digest, TPMI_ALG_HASH current_hash_alg)"
  561. Calculate a policy digest for a certain PCR selection\&.
  562. .PP
  563. From a PCR list the list of PCR values and the corresponding PCR digest is computed\&. The passed policy digest will be extended with this data and also with the policy command code\&.
  564. .PP
  565. \fBParameters:\fP
  566. .RS 4
  567. \fIpolicy\fP The policy with the list of selected PCRs\&.
  568. .br
  569. \fIcurrent_digest\fP The digest list which has to be updated\&.
  570. .br
  571. \fIcurrent_hash_alg\fP The hash algorithm used for the policy computation\&.
  572. .RE
  573. .PP
  574. \fBReturn values:\fP
  575. .RS 4
  576. \fITSS2_RC_SUCCESS\fP on success\&.
  577. .br
  578. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  579. .br
  580. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  581. .br
  582. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  583. .br
  584. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  585. .RE
  586. .PP
  587. .SH "Author"
  588. .PP
  589. Generated automatically by Doxygen for tpm2-tss from the source code\&.