tpm2-tss  master
TPM Software stack 2.0 TCG spec compliant implementation
Policy utilitiy module

Functions

TSS2_RC ifapi_policyutil_execute (FAPI_CONTEXT *context, ESYS_TR *session)
 
TSS2_RC ifapi_policyutil_execute_prepare (FAPI_CONTEXT *context, TPMI_ALG_HASH hash_alg, TPMS_POLICY *policy)
 

Detailed Description

Provides functions for the execution of policies for object authorization.

Function Documentation

◆ ifapi_policyutil_execute()

TSS2_RC ifapi_policyutil_execute ( FAPI_CONTEXT context,
ESYS_TR session 
)

State machine to Execute the TPM policy commands needed for the current policy.

In the first step a session will be created if no session is passed. In the second step the policy engine will execute the policy.

Parameters
[in,out]contextThe fapi context with the pointer to the policy stack.
[in,out]sessionThe policy session to be extended or if the value is equal zero or ESYS_TR_NONE a new created session will been be stored in this parameter.
Return values
TSS2_RC_SUCCESSon success.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.
TSS2_FAPI_RC_BAD_VALUEIf wrong values are detected during execution.
TSS2_FAPI_RC_IO_ERRORIf an error occurs during access to the policy store.
TSS2_FAPI_RC_POLICY_UNKNOWNIf policy search for a certain policy digest was not successful.
TSS2_FAPI_RC_BAD_TEMPLATEIn a invalid policy is loaded during execution.
TPM2_RC_BAD_AUTHIf the authentication for an object needed for policy execution fails.
TSS2_FAPI_RC_GENERAL_FAILUREif an internal error occurred.
TSS2_FAPI_RC_TRY_AGAINif an I/O operation is not finished yet and this function needs to be called again.
TSS2_FAPI_RC_BAD_SEQUENCEif the context has an asynchronous operation already pending.
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.
TSS2_FAPI_RC_PATH_NOT_FOUNDif a FAPI object path was not found during authorization.
TSS2_FAPI_RC_KEY_NOT_FOUNDif a key was not found.
TSS2_FAPI_RC_AUTHORIZATION_UNKNOWNif a required authorization callback is not set.
TSS2_FAPI_RC_AUTHORIZATION_FAILEDif the authorization attempt fails.
TSS2_ESYS_RC_*possible error codes of ESAPI.
TSS2_FAPI_RC_BAD_PATHif the path is used in inappropriate context or contains illegal characters.
TSS2_FAPI_RC_NOT_PROVISIONEDFAPI was not provisioned.

◆ ifapi_policyutil_execute_prepare()

TSS2_RC ifapi_policyutil_execute_prepare ( FAPI_CONTEXT context,
TPMI_ALG_HASH  hash_alg,
TPMS_POLICY policy 
)

Prepare the execution of a new policy on policy stack.

The context for the policy utility, the policy execution and the needed callbacks is initialized. The policy execution will be prepared. In this step the list of policies to be executed will be computed.

Parameters
[in,out]contextThe fapi context with the pointer to the policy stack.
[in]hash_algThe hash algorithm used for the policy computation.
[in,out]policyThe policy to be executed. Some policy elements will be used to store computed parameters needed for policy execution.
Return values
TSS2_RC_SUCCESSon success.
TSS2_FAPI_RC_AUTHORIZATION_UNKNOWNIf the callback for branch selection is not defined. This callback will be needed of or policies have to be executed.
TSS2_FAPI_RC_BAD_VALUEIf the computed branch index delivered by the callback does not identify a branch.
TSS2_FAPI_RC_BAD_REFERENCEIf no context is passed.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.
TSS2_FAPI_RC_AUTHORIZATION_FAILEDif the authorization attempt fails.
TSS2_ESYS_RC_*possible error codes of ESAPI.