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

Functions

TSS2_RC ifapi_policy_delete (IFAPI_POLICY_STORE *pstore, char *path)
 
TSS2_RC ifapi_policy_store_initialize (IFAPI_POLICY_STORE *pstore, const char *config_policydir)
 
TSS2_RC ifapi_policy_store_load_async (IFAPI_POLICY_STORE *pstore, IFAPI_IO *io, const char *path)
 
TSS2_RC ifapi_policy_store_load_finish (IFAPI_POLICY_STORE *pstore, IFAPI_IO *io, TPMS_POLICY *policy)
 
TSS2_RC ifapi_policy_store_store_async (IFAPI_POLICY_STORE *pstore, IFAPI_IO *io, const char *path, const TPMS_POLICY *policy)
 
TSS2_RC ifapi_policy_store_store_finish (IFAPI_POLICY_STORE *pstore, IFAPI_IO *io)
 

Detailed Description

Provides internal fapi functions for reading and writing to the policy store.

Function Documentation

◆ ifapi_policy_delete()

TSS2_RC ifapi_policy_delete ( IFAPI_POLICY_STORE pstore,
char *  path 
)

Remove file storing a policy object.

Parameters
[in]pstoreThe policy directory.
[in]pathThe relative name of the object be removed.
Return values
TSS2_RC_SUCCESSOn success.
TSS2_FAPI_RC_MEMORYIf memory could not be allocated.
TSS2_FAPI_RC_PATH_NOT_FOUNDIf no file is found in policy store.
TSS2_FAPI_RC_IO_ERRORIf the file can't be removed.

◆ ifapi_policy_store_initialize()

TSS2_RC ifapi_policy_store_initialize ( IFAPI_POLICY_STORE pstore,
const char *  config_policydir 
)

Store policy store parameters in the policy store context.

Also the user directory will be created if it does not exist.

Parameters
[out]pstoreThe keystore to be initialized.
[in]config_policydirThe configured policy directory.
Return values
TSS2_RC_SUCCESSIf the keystore can be initialized.
TSS2_FAPI_RC_IO_ERRORIf the policy store can't be initialized.
TSS2_FAPI_RC_MEMORYif memory could not be allocated.
TSS2_FAPI_RC_BAD_VALUEif an invalid value was passed into the function.
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.

◆ ifapi_policy_store_load_async()

TSS2_RC ifapi_policy_store_load_async ( IFAPI_POLICY_STORE pstore,
IFAPI_IO io,
const char *  path 
)

Start loading FAPI policy from policy store.

Keys objects, NV objects, and hierarchies can be loaded.

Parameters
[in]pstoreThe policy directory.
[in]ioThe input/output context being used for file I/O.
[in]pathThe relative path of the object. For keys the path will expanded if possible.
Return values
TSS2_RC_SUCCESSIf the object can be read.
TSS2_FAPI_RC_IO_ERRORif an I/O error was encountered.
TSS2_FAPI_RC_PATH_NOT_FOUNDif the file does not exist.
TSS2_FAPI_RC_MEMORYif memory could not be allocated to hold the read data.

◆ ifapi_policy_store_load_finish()

TSS2_RC ifapi_policy_store_load_finish ( IFAPI_POLICY_STORE pstore,
IFAPI_IO io,
TPMS_POLICY policy 
)

Finish loading FAPI policy from policy store.

This function needs to be called repeatedly until it does not return TSS2_FAPI_RC_TRY_AGAIN.

Parameters
[in]pstoreThe policy context with the policy directory.
[in,out]ioThe input/output context being used for file I/O.
[in]policyThe caller allocated policy which will loaded from policy store.
Return values
TSS2_RC_SUCCESSAfter successfully loading the object.
TSS2_FAPI_RC_IO_ERRORif an I/O error was encountered; such as the file was not found.
TSS2_FAPI_RC_TRY_AGAINif the asynchronous operation is not yet complete.
TSS2_FAPI_RC_GENERAL_FAILUREif an internal error occurred.
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.
TSS2_FAPI_RC_BAD_VALUEif an invalid value was passed into the function.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.

◆ ifapi_policy_store_store_async()

TSS2_RC ifapi_policy_store_store_async ( IFAPI_POLICY_STORE pstore,
IFAPI_IO io,
const char *  path,
const TPMS_POLICY policy 
)

Start writing FAPI object to the key store.

The relative path will be expanded, if the default policy directory (/policy) is not part of the path.

Parameters
[in]pstoreThe policy context with the policy directory.
[in]ioThe input/output context being used for file I/O.
[in]pathThe relative path of the policy.
[in]policyThe policy to be written to the policy store.
Return values
TSS2_RC_SUCCESSIf the policy is written successfully.
TSS2_FAPI_RC_IO_ERRORIf an I/O error was encountered;
TSS2_FAPI_RC_MEMORYIf memory could not be allocated to hold the output data.
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.
TSS2_FAPI_RC_BAD_VALUEif an invalid value was passed into the function.

◆ ifapi_policy_store_store_finish()

TSS2_RC ifapi_policy_store_store_finish ( IFAPI_POLICY_STORE pstore,
IFAPI_IO io 
)

Finish writing a FAPI policy object to the policy store.

This function needs to be called repeatedly until it does not return TSS2_FAPI_RC_TRY_AGAIN.

Parameters
[in]pstoreThe policy context with the policy directory.
[in,out]ioThe input/output context being used for file I/O.
Return values
TSS2_RC_SUCCESSif the function call was a success.
TSS2_FAPI_RC_IO_ERRORif an I/O error was encountered; such as the file was not found.
TSS2_FAPI_RC_TRY_AGAINif the asynchronous operation is not yet complete. Call this function again later.