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

Functions

void ifapi_profiles_finalize (IFAPI_PROFILES *profiles)
 
TSS2_RC ifapi_profiles_get (const IFAPI_PROFILES *profiles, const char *name, const IFAPI_PROFILE **profile)
 
TSS2_RC ifapi_profiles_initialize_async (IFAPI_PROFILES *profiles, IFAPI_IO *io, const char *profilesdir, const char *defaultprofile)
 
TSS2_RC ifapi_profiles_initialize_finish (IFAPI_PROFILES *profiles, IFAPI_IO *io)
 

Detailed Description

Provides functions for the handling of profiles stored in the object store.

Function Documentation

◆ ifapi_profiles_finalize()

void ifapi_profiles_finalize ( IFAPI_PROFILES profiles)

Sanitizes and frees internal data structures of loaded profiles' information.

Parameters
[in,out]profilesThe context for the profiles information.

◆ ifapi_profiles_get()

TSS2_RC ifapi_profiles_get ( const IFAPI_PROFILES profiles,
const char *  name,
const IFAPI_PROFILE **  profile 
)

Return the profile data for a given profile name.

Returns a (const, not to be free'd) pointer to the profile data for a requested profile. If a NULL profile is requesten, then the default profile is returned. If a keypath is passed in, then the prefix is analysed. If that keypath starts with a profile then this profile is returned. Otherwise the default profile is returned.

Parameters
[in]profilesThe profiles context
[in]nameThe name of the profile or the keypath
[out]profileThe pointer to the profile data.
Return values
TSS2_RC_SUCCESSon success.
TSS2_FAPI_RC_BAD_REFERENCEif NULL pointers were passed in.
TSS2_FAPI_RC_BAD_VALUEif a profile is not found.

◆ ifapi_profiles_initialize_async()

TSS2_RC ifapi_profiles_initialize_async ( IFAPI_PROFILES profiles,
IFAPI_IO io,
const char *  profilesdir,
const char *  defaultprofile 
)

Initialize the profiles information in the context in an asynchronous way

Load the profile information from disk, fill the dictionary of loaded profiles and fill the default profile information into the context.

Call ifapi_profiles_initialize_finish to complete the operation.

Parameters
[in,out]profilesThe context for the profiles information.
[in,out]ioThe input/output context being used for file I/O.
[in]profilesdirThe directory to load profile information from.
[in]defaultprofileThe name of the default profile to use.
Return values
TSS2_RC_SUCCESSon success.
TSS2_FAPI_RC_BAD_REFERENCEif NULL pointers were passed in.
TSS2_FAPI_RC_BAD_VALUEif the profilesdir does not exist or is empty.
TSS2_FAPI_RC_IO_ERRORif creation of log_dir failed or log_dir is not writable.
TSS2_FAPI_RC_MEMORYif memory allocation failed.

◆ ifapi_profiles_initialize_finish()

TSS2_RC ifapi_profiles_initialize_finish ( IFAPI_PROFILES profiles,
IFAPI_IO io 
)

Initialize the profiles information in the context in an asynchronous way

Call after ifapi_profiles_initialize_async to complete the operation.

Parameters
[in,out]profilesThe context for the profiles information.
[in,out]ioThe input/output context being used for file I/O.
Return values
TSS2_RC_SUCCESSon success.
TSS2_FAPI_RC_BAD_REFERENCEif NULL pointers were passed in.
TSS2_FAPI_RC_BAD_VALUEif a profile could not be loaded.
TSS2_FAPI_RC_IO_ERRORif creation of log_dir failed or log_dir is not writable.
TSS2_FAPI_RC_MEMORYif memory allocation failed.
TSS2_FAPI_RC_TRY_AGAINif the I/O operation is not finished yet and this function needs to be called again.