ifapi_policy_execution.3 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. .TH "ifapi_policy_execution" 3 "Fri Oct 7 2022" "Version 3.2.0" "tpm2-tss" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. ifapi_policy_execution
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .SS "Functions"
  10. .in +1c
  11. .ti -1c
  12. .RI "TSS2_RC \fBget_policy_digest_idx\fP (TPML_DIGEST_VALUES *digest_values, TPMI_ALG_HASH hashAlg, size_t *idx)"
  13. .br
  14. .ti -1c
  15. .RI "TSS2_RC \fBifapi_extend_authorization\fP (\fBTPMS_POLICY\fP *policy, \fBTPMS_POLICYAUTHORIZATION\fP *authorization)"
  16. .br
  17. .ti -1c
  18. .RI "TSS2_RC \fBifapi_policyeval_execute\fP (\fBESYS_CONTEXT\fP *esys_ctx, \fBIFAPI_POLICY_EXEC_CTX\fP *current_policy)"
  19. .br
  20. .ti -1c
  21. .RI "TSS2_RC \fBifapi_policyeval_execute_prepare\fP (\fBIFAPI_POLICY_EXEC_CTX\fP *pol_ctx, TPMI_ALG_HASH hash_alg, \fBTPMS_POLICY\fP *policy)"
  22. .br
  23. .in -1c
  24. .SH "Detailed Description"
  25. .PP
  26. Provides internal functions for policy execution\&.
  27. .SH "Function Documentation"
  28. .PP
  29. .SS "TSS2_RC get_policy_digest_idx (TPML_DIGEST_VALUES * digest_values, TPMI_ALG_HASH hashAlg, size_t * idx)"
  30. Compute the index for the current digest list and clear the digest\&.
  31. .PP
  32. The list entry with the appropriate hash algorithm will be searched\&. The found digest will be set to zero\&.
  33. .PP
  34. \fBParameters:\fP
  35. .RS 4
  36. \fIdigest_values\fP The list of policy digests and corresponding hash algorithms\&.
  37. .br
  38. \fIhashAlg\fP The hash algorithm to be searched\&.
  39. .br
  40. \fIidx\fP The index of the found digest\&.
  41. .RE
  42. .PP
  43. \fBReturn values:\fP
  44. .RS 4
  45. \fITSS2_RC_SUCCESS\fP on success\&.
  46. .br
  47. \fITSS2_FAPI_RC_BAD_VALUE\fP If no appropriate digest was found in the digest list\&.
  48. .RE
  49. .PP
  50. .SS "TSS2_RC ifapi_extend_authorization (\fBTPMS_POLICY\fP * policy, \fBTPMS_POLICYAUTHORIZATION\fP * authorization)"
  51. Add a new authorization to a policy\&.
  52. .PP
  53. The the signed hash computed from the policy digest and the policyRef together with the public key of the key used for signing will be stored in the policy\&.
  54. .PP
  55. \fBParameters:\fP
  56. .RS 4
  57. \fIpolicy\fP The policy to be authorized\&.
  58. .br
  59. \fIauthorization\fP The structure with the signature, the policyRef and the public key\&.
  60. .RE
  61. .PP
  62. \fBReturn values:\fP
  63. .RS 4
  64. \fITSS2_RC_SUCCESS\fP on success\&.
  65. .br
  66. \fITSS2_FAPI_RC_MEMORY\fP If the memory for the authorization list cannot be allocated\&.
  67. .RE
  68. .PP
  69. .SS "TSS2_RC ifapi_policyeval_execute (\fBESYS_CONTEXT\fP * esys_ctx, \fBIFAPI_POLICY_EXEC_CTX\fP * current_policy)"
  70. Execute all policy commands defined by a list of policy elements\&.
  71. .PP
  72. \fBReturn values:\fP
  73. .RS 4
  74. \fITSS2_RC_SUCCESS\fP on success\&.
  75. .br
  76. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  77. .br
  78. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during execution\&.
  79. .br
  80. \fITSS2_FAPI_RC_IO_ERROR\fP If an error occurs during access to the policy store\&.
  81. .br
  82. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP If policy search for a certain policy digest was not successful\&.
  83. .br
  84. \fITSS2_FAPI_RC_BAD_TEMPLATE\fP In a invalid policy is loaded during execution\&.
  85. .br
  86. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  87. .br
  88. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  89. .br
  90. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  91. .br
  92. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  93. .br
  94. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  95. .br
  96. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  97. .br
  98. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a required authorization callback is not set\&.
  99. .br
  100. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  101. .br
  102. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  103. .br
  104. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  105. .br
  106. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  107. .RE
  108. .PP
  109. .SS "TSS2_RC ifapi_policyeval_execute_prepare (\fBIFAPI_POLICY_EXEC_CTX\fP * pol_ctx, TPMI_ALG_HASH hash_alg, \fBTPMS_POLICY\fP * policy)"
  110. Initialize policy element list to be executed and store policy in context\&.
  111. .PP
  112. \fBParameters:\fP
  113. .RS 4
  114. \fIpol_ctx\fP Context for execution of a list of policy elements\&.
  115. .br
  116. \fIhash_alg\fP The hash algorithm used for the policy computation\&.
  117. .br
  118. \fIpolicy\fP The policy to be executed\&. Some policy elements will be used to store computed parameters needed for policy execution\&.
  119. .RE
  120. .PP
  121. \fBReturn values:\fP
  122. .RS 4
  123. \fITSS2_RC_SUCCESS\fP on success\&.
  124. .br
  125. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP If the callback for branch selection is not defined\&. This callback will be needed of or policies have to be executed\&.
  126. .br
  127. \fITSS2_FAPI_RC_BAD_VALUE\fP If the computed branch index deliverd by the callback does not identify a branch\&.
  128. .br
  129. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  130. .br
  131. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  132. .br
  133. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  134. .RE
  135. .PP
  136. .SH "Author"
  137. .PP
  138. Generated automatically by Doxygen for tpm2-tss from the source code\&.