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

Functions

bool add_string_to_list (NODE_STR_T *str_list, char *string)
 
TSS2_RC append_object_to_list (void *object, NODE_OBJECT_T **object_list)
 
void free_string_list (NODE_STR_T *node)
 
char * get_description (IFAPI_OBJECT *object)
 
bool ifapi_TPM2B_DIGEST_cmp (TPM2B_DIGEST *in1, TPM2B_DIGEST *in2)
 
bool ifapi_TPM2B_ECC_PARAMETER_cmp (TPM2B_ECC_PARAMETER *in1, TPM2B_ECC_PARAMETER *in2)
 
bool ifapi_TPM2B_PUBLIC_KEY_RSA_cmp (TPM2B_PUBLIC_KEY_RSA *in1, TPM2B_PUBLIC_KEY_RSA *in2)
 
bool ifapi_TPMS_ECC_POINT_cmp (TPMS_ECC_POINT *in1, TPMS_ECC_POINT *in2)
 
bool ifapi_TPMT_PUBLIC_cmp (TPMT_PUBLIC *in1, TPMT_PUBLIC *in2)
 
bool ifapi_TPMU_PUBLIC_ID_cmp (TPMU_PUBLIC_ID *in1, UINT32 selector1, TPMU_PUBLIC_ID *in2, UINT32 selector2)
 
TSS2_RC ifapi_asprintf (char **str, const char *fmt,...)
 
TSS2_RC ifapi_check_profile_pcr_selection (const TPML_PCR_SELECTION *pcr_profile, const TPML_PCR_SELECTION *pcr_capablity)
 
void ifapi_cleanup_policy (TPMS_POLICY *policy)
 
bool ifapi_cmp_public_key (TPM2B_PUBLIC *key1, TPM2B_PUBLIC *key2)
 
TSS2_RC ifapi_compute_policy_digest (TPML_PCRVALUES *pcrs, TPML_PCR_SELECTION *pcr_selection, TPMI_ALG_HASH hash_alg, TPM2B_DIGEST *pcr_digest)
 
TPMS_POLICYifapi_copy_policy (const TPMS_POLICY *from_policy)
 
TSS2_RC ifapi_create_dirs (const char *supdir, const char *path)
 
TSS2_RC ifapi_extend_vpcr (TPM2B_DIGEST *vpcr, TPMI_ALG_HASH bank, const IFAPI_EVENT *event)
 
TSS2_RC ifapi_filter_pcr_selection_by_index (TPML_PCR_SELECTION *pcr_selection, const TPM2_HANDLE *pcr_index, size_t pcr_count)
 
void ifapi_free_node_list (NODE_OBJECT_T *node)
 
void ifapi_free_object_list (NODE_OBJECT_T *node)
 
int ifapi_get_curl_buffer (unsigned char *url, unsigned char **buffer, size_t *buffer_size)
 
ESYS_TR ifapi_get_hierary_handle (const char *path)
 
TSS2_RC ifapi_get_name (TPMT_PUBLIC *publicInfo, TPM2B_NAME *name)
 
TSS2_RC ifapi_get_nv_start_index (const char *path, TPM2_HANDLE *start_nv_index)
 
TSS2_RC ifapi_get_quote_info (char const *quoteInfo, TPM2B_ATTEST *tpm_quoted, FAPI_QUOTE_INFO *fapi_quote_info)
 
bool ifapi_hierarchy_path_p (const char *path)
 
void ifapi_init_hierarchy_object (IFAPI_OBJECT *hierarchy, ESYS_TR esys_handle)
 
TSS2_RC ifapi_object_cmp_name (IFAPI_OBJECT *object, void *name, bool *equal)
 
TSS2_RC ifapi_object_cmp_nv_public (IFAPI_OBJECT *object, void *nv_public, bool *equal)
 
size_t ifapi_path_length (NODE_STR_T *node)
 
TSS2_RC ifapi_path_string (char **dest, const char *supdir, NODE_STR_T *node, char *name)
 
TSS2_RC ifapi_path_string_n (char **dest, const char *supdir, NODE_STR_T *node, char *name, size_t n)
 
bool ifapi_path_type_p (const char *path, const char *type)
 
TSS2_RC ifapi_set_key_flags (const char *type, bool policy, IFAPI_KEY_TEMPLATE *template)
 
TSS2_RC ifapi_set_nv_flags (const char *type, IFAPI_NV_TEMPLATE *template, const char *policy)
 
TSS2_RC ifapi_tpm_to_fapi_signature (IFAPI_OBJECT *sig_key_object, TPMT_SIGNATURE *tpm_signature, uint8_t **signature, size_t *signatureSize)
 
NODE_STR_Tinit_string_list (const char *string)
 
bool object_with_auth (IFAPI_OBJECT *object)
 
TSS2_RC push_object_to_list (void *object, NODE_OBJECT_T **object_list)
 
NODE_STR_Tsplit_string (const char *string, char *delimiter)
 
int vasprintf (char **str, const char *fmt, va_list args)
 
TSS2_RC ifapi_check_nv_index (const char *path, TPM2_HANDLE nv_index)
 
bool ifapi_null_primary_p (const char *path)
 

Detailed Description

Provides helper functions.

Function Documentation

◆ add_string_to_list()

bool add_string_to_list ( NODE_STR_T str_list,
char *  string 
)

Add string to the last element of a linked list of strings.

A duplicate of the passed string will be added.

Parameters
[in,out]str_listThe linked list.
[in]stringThe string to be added.
Return values
trueif the string was added to the list.
falseif the list could not be extended.

◆ append_object_to_list()

TSS2_RC append_object_to_list ( void *  object,
NODE_OBJECT_T **  object_list 
)

Add a object as last element to a linked list.

Parameters
[in]objectThe object to be added.
[in,out]object_listThe linked list to be extended.
Return values
TSS2_RC_SUCCESSif the object was added.
TSS2_FAPI_RC_MEMORYIf memory for the list extension cannot be allocated.

◆ free_string_list()

void free_string_list ( NODE_STR_T node)

Free linked list of strings.

Parameters
[in]nodethe first node of the linked list.

◆ ifapi_asprintf()

TSS2_RC ifapi_asprintf ( char **  str,
const char *  fmt,
  ... 
)

Print to allocated string.

A list of parameters will be printed to an allocated string according to the format description in the first parameter.

Parameters
[out]strThe allocated output string.
[in]fmtThe format string (printf formats can be used.)
[in]...The list of objects to be printed.
Return values
TSS2_RC_SUCCESSIf the printing was successful.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.

◆ ifapi_check_nv_index()

ifapi_check_nv_index ( const char *  path,
TPM2_HANDLE  nv_index 
)

Check whether NV index is appropriate for NV path.

The value will be checked based on e TCG handle registry.

Parameters
[in]pathThe path used for the NV object.
[out]nv_indexThe NV index to be used.
Return values
TSS2_RC_SUCCESSIf the index for the path can be determined.
TSS2_FAPI_RC_BAD_PATHIf the path is not valid.
TSS2_FAPI_RC_BAD_VALUEIf the nv index is not appropriate for the path.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.

◆ ifapi_check_profile_pcr_selection()

TSS2_RC ifapi_check_profile_pcr_selection ( const TPML_PCR_SELECTION *  pcr_profile,
const TPML_PCR_SELECTION *  pcr_capablity 
)

Check whether profile PCR capabilities are a subset of TPM PCR capabilities.

It has to be checked that every hash alg from the profile is available and whether the selected PCRs are available.

Parameters
[in]pcr_profileThe pcr profile to use as basis for the selection.
[in]pcr_capablityThe PCR capabilities available for TPM.
Return values
TSS2_RC_SUCCESSSif the conversion was successful.
TSS2_FAPI_RC_BAD_VALUEif profile is not subset of capabilities.

◆ ifapi_cleanup_policy()

void ifapi_cleanup_policy ( TPMS_POLICY policy)

Free memory allocated during deserialization of policy.

The object will not be freed (might be declared on the stack).

Parameters
[in]policyThe policy to be cleaned up.

◆ ifapi_cmp_public_key()

bool ifapi_cmp_public_key ( TPM2B_PUBLIC *  key1,
TPM2B_PUBLIC *  key2 
)

Compare two public keys.

Parameters
[in]key1The first key.
[in]key2The second key.
Return values
trueif equal false if not.

◆ ifapi_compute_policy_digest()

TSS2_RC ifapi_compute_policy_digest ( TPML_PCRVALUES *  pcrs,
TPML_PCR_SELECTION *  pcr_selection,
TPMI_ALG_HASH  hash_alg,
TPM2B_DIGEST *  pcr_digest 
)

Compute PCR selection and a PCR digest for a PCR value list.

Parameters
[in]pcrsThe list of PCR values.
[out]pcr_selectionThe selection computed based on the list of PCR values.
[in]hash_algThe hash algorithm which is used for the policy computation.
[out]pcr_digestThe computed PCR digest corresponding to the passed PCR value list.
Return values
TSS2_RC_SUCCESSif the PCR selection and the PCR digest could be computed..
TSS2_FAPI_RC_BAD_VALUEIf inappropriate values are detected in the input data.
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.
TSS2_FAPI_RC_GENERAL_FAILUREif an internal error occurred.

◆ ifapi_copy_policy()

TPMS_POLICY * ifapi_copy_policy ( const TPMS_POLICY from_policy)

Copy policy.

Parameters
[in]from_policythe policy to be copied.
Return values
Thenew policy or NULL if not enough memory was available.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.

◆ ifapi_create_dirs()

TSS2_RC ifapi_create_dirs ( const char *  supdir,
const char *  path 
)

Create sub-directories in a certain directory.

Parameters
[in]supdirThe directory in which the new directories shall be created.
[in]pathThe path containing one or more sub-directories.
Return values
TSS2_RC_SUCCESSIf the directories were created.
TSS2_FAPI_RC_MEMORYIf the linked list with the sub-directories cannot be allocated.
TSS2_FAPI_RC_BAD_VALUEIf a directory cannot be created.

◆ ifapi_extend_vpcr()

TSS2_RC ifapi_extend_vpcr ( TPM2B_DIGEST *  vpcr,
TPMI_ALG_HASH  bank,
const IFAPI_EVENT event 
)

Compute new PCR value from a part of an event list.

Parameters
[in,out]vpcrThe old and the new PCR value.
[in]bankThe bank corresponding to value of the event list which will be used for computation.
[in]eventThe event list with the values which were extended for a certain bank.
Return values
TSS2_FAPI_RC_BAD_VALUEif the bank was not found in the event list.
TSS2_FAPI_RC_GENERAL_FAILUREif an error occurs in the crypto library
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.

◆ ifapi_filter_pcr_selection_by_index()

TSS2_RC ifapi_filter_pcr_selection_by_index ( TPML_PCR_SELECTION *  pcr_selection,
const TPM2_HANDLE *  pcr_index,
size_t  pcr_count 
)

Reduce a PCR selection to a single pcr.

This includes two steps: clearing all bits but the selected and clearing empty hashalg lines.

Parameters
[in,out]pcr_selectionThe pcr selection to be filtered.
[in]pcr_indexThe only PCR to remain selected.
[in]pcr_countThe size of the pcr list.
Return values
TSS2_RC_SUCCESSif the filtering was successful.
TSS2_FAPI_RC_BAD_VALUEif no pcr remain selected or the pcr selection is malformed.

◆ ifapi_free_node_list()

void ifapi_free_node_list ( NODE_OBJECT_T node)

Free linked list of IFAPI objects (link nodes only).

Parameters
[in]nodethe first node of the linked list.

◆ ifapi_free_object_list()

void ifapi_free_object_list ( NODE_OBJECT_T node)

Free linked list of IFAPI objects.

Parameters
[in]nodethe first node of the linked list.

◆ ifapi_get_curl_buffer()

int ifapi_get_curl_buffer ( unsigned char *  url,
unsigned char **  buffer,
size_t *  buffer_size 
)

Get byte buffer from file system or web via curl.

Parameters
[in]urlThe url of the resource.
[out]bufferThe buffer retrieved via the url.
[out]buffer_sizeThe size of the retrieved object.
Return values
0if buffer could be retrieved.
-1if an error did occur

◆ ifapi_get_hierary_handle()

ESYS_TR ifapi_get_hierary_handle ( const char *  path)

Get ESYS handle for a hierarchy path.

Parameters
[in]pathThe path to be checked.
Return values
TheESAPI handle for the hierarchy defined in path.
0if not handle can be assigned.

◆ ifapi_get_name()

TSS2_RC ifapi_get_name ( TPMT_PUBLIC *  publicInfo,
TPM2B_NAME *  name 
)

Compute the name of a TPM transient or persistent object.

Parameters
[in]publicInfoThe public information of the TPM object.
[out]nameThe computed name.
Return values
TPM2_RC_SUCCESSor one of the possible errors TSS2_FAPI_RC_BAD_VALUE, TSS2_FAPI_RC_MEMORY, TSS2_FAPI_RC_GENERAL_FAILURE. or return codes of SAPI errors.
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.
TSS2_FAPI_RC_BAD_VALUEif an invalid value was passed into the function.
TSS2_FAPI_RC_GENERAL_FAILUREif an internal error occurred.

◆ ifapi_get_nv_start_index()

TSS2_RC ifapi_get_nv_start_index ( const char *  path,
TPM2_HANDLE *  start_nv_index 
)

Determine start index for NV object depending on type.

The value will be determined based on e TCG handle registry.

Parameters
[in]pathThe path used for the NV object.
[out]start_nv_indexThe first possible NV index for this type.
Return values
TSS2_RC_SUCCESSIf the index for the path can be determined.
TSS2_FAPI_RC_BAD_PATHIf no handle can be assigned.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.

◆ ifapi_get_quote_info()

TSS2_RC ifapi_get_quote_info ( char const *  quoteInfo,
TPM2B_ATTEST *  tpm_quoted,
FAPI_QUOTE_INFO fapi_quote_info 
)

Deserialize the JSON representation of FAPI quote information.

The JSON representation of FAPI quote information will be deserialized to a FAPI_QUOTE_INFO structure and also the TPM2B version of the attest will be created.

Parameters
[in]quoteInfoThe JSON representation if the quote information.
[out]tpm_quotedThe marhaled version of the attest structure.
[out]fapi_quote_infoThe quote information structure used by FAPI.
Return values
TSS2_RC_SUCCESSIf the deserialization was successful.
TSS2_FAPI_RC_BAD_VALUEIf an invalid value is detected during deserialisation.
Possibleerror codes of the marshaling function.
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.

◆ ifapi_hierarchy_path_p()

bool ifapi_hierarchy_path_p ( const char *  path)

Determine whether path describes a hierarchy object.

It will be checked whether the path describes a hierarch. A key path with a hierarchy will not deliver true.

Parameters
[in]pathThe path to be checked.
Return values
trueif the path describes a hierarchy.
falseif not.

◆ ifapi_init_hierarchy_object()

void ifapi_init_hierarchy_object ( IFAPI_OBJECT hierarchy,
ESYS_TR  esys_handle 
)

Initialize the internal representation of a FAPI hierarchy object.

The object will be cleared and the type of the general fapi object will be set to hierarchy.

Parameters
[in,out]hierarchyThe caller allocated hierarchy object. The name of the object will be computed.
[in]esys_handleThe ESAPI handle of the hierarchy which will be added to to the object.

◆ ifapi_null_primary_p()

ifapi_null_primary_p ( const char *  path)

Determine whether path is a primary in the null hierarchy.

Parameters
[in]pathThe path to be checked.
Return values
trueif the path describes a null hierarchy primary.
falseif not.

◆ ifapi_object_cmp_name()

TSS2_RC ifapi_object_cmp_name ( IFAPI_OBJECT object,
void *  name,
bool *  equal 
)

Check whether a nv or key object has a certain name.

Parameters
[in]objectThe object (has to be checked whether it's a key).
[in]nameThe name to be compared.
[out]equalIf the two names are equal.
Return values
TSS2_RC_SUCCESSSif name of object can be deserialized.
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.
TSS2_FAPI_RC_BAD_VALUEif an invalid value was passed into the function.
TSS2_FAPI_RC_GENERAL_FAILUREif an internal error occurred.

◆ ifapi_object_cmp_nv_public()

TSS2_RC ifapi_object_cmp_nv_public ( IFAPI_OBJECT object,
void *  nv_public,
bool *  equal 
)

Check whether a nv object has a certain public info.

Parameters
[in]objectThe object (has to be checked whether it's a key).
[in]nv_publicThe NV public data with the NV index.
[out]equalIf the two names are equal.
Return values
TSS2_RC_SUCCESSSif name of object can be deserialized.

◆ ifapi_path_length()

size_t ifapi_path_length ( NODE_STR_T node)

Compute the number on nodes in a linked list.

Parameters
[in]nodethe first node of the linked list.
Return values
thenumber on nodes.

◆ ifapi_path_string()

TSS2_RC ifapi_path_string ( char **  dest,
const char *  supdir,
NODE_STR_T node,
char *  name 
)

Compute a pathname based on a linked list of strings.

Parameters
[out]destThe pointer to the generated pathname (callee allocated).
[in]supdirA sup directory will be the prefix of the pathname.
[in]nodeThe linked list.
[in]nameA name which is appended to the result if not NULL.
Return values
TSS2_RC_SUCCESSif the function call was a success.
TSS2_FAPI_RC_MEMORYif the memory for the pathname can't be allocated.

◆ ifapi_path_string_n()

TSS2_RC ifapi_path_string_n ( char **  dest,
const char *  supdir,
NODE_STR_T node,
char *  name,
size_t  n 
)

Compute a pathname based on the first n elements of a linked list of strings.

Parameters
[out]destthe pointer to the pathname (callee allocated).
[in]supdira sup directory will be the prefix of the pathname. (can be NULL).
[in]nodethe linked list.
[in]namethe filename (can be NULL).
[in]nthe number of the first elements which will bes used for concatenation.
Return values
TSS2_RC_SUCCESSif the function call was a success.
TSS2_FAPI_RC_MEMORYif the memory for the pathname can't be allocated.

◆ ifapi_path_type_p()

bool ifapi_path_type_p ( const char *  path,
const char *  type 
)

Determine whether path is of certain type.

Parameters
[in]pathThe path to be checked.
[in]typesub-string at the beginning of the path to be checked.
Return values
trueif the path name starts with type.
falseif not.

◆ ifapi_set_key_flags()

TSS2_RC ifapi_set_key_flags ( const char *  type,
bool  policy,
IFAPI_KEY_TEMPLATE template 
)

Create template for key creation based on type flags.

Based on passed flags the TPM2B_PUBLIC data which is used for key creation will be adapted.

Parameters
[in]typeThe flags describing the key type.
[in]policyThe flag whether a policy is used.
[out]templateThe template including the TPM2B_PUBLIC which will be used for key creation.
Return values
TSS2_RC_SUCCESSif the template can be generated.
TSS2_FAPI_RC_BAD_VALUEIf an invalid combination of flags was used.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.

◆ ifapi_set_nv_flags()

TSS2_RC ifapi_set_nv_flags ( const char *  type,
IFAPI_NV_TEMPLATE template,
const char *  policy 
)

Create template for nv object creation based on type flags.

Based on passed flags the TPM2B_NV_PUBLIC data which is used for key creation will be adapted.

Parameters
[in]typeThe flags describing the nv object type.
[in]policyThe flag whether a policy is used.
[out]templateThe template including the TPM2B_NV_PUBLIC which will be used for nv object creation.
Return values
TSS2_RC_SUCCESSif the template can be generated.
TSS2_FAPI_RC_BAD_VALUEIf an invalid combination of flags was used.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.

◆ ifapi_TPM2B_DIGEST_cmp()

bool ifapi_TPM2B_DIGEST_cmp ( TPM2B_DIGEST *  in1,
TPM2B_DIGEST *  in2 
)

Compare two variables of type TPM2B_DIGEST.

Parameters
[in]in1variable to be compared with in2.
[in]in2variable to be compared with in1.
Return values
trueif the variables are equal.
falseif not.

◆ ifapi_TPM2B_ECC_PARAMETER_cmp()

bool ifapi_TPM2B_ECC_PARAMETER_cmp ( TPM2B_ECC_PARAMETER *  in1,
TPM2B_ECC_PARAMETER *  in2 
)

Compare two variables of type TPM2B_ECC_PARAMETER.

Parameters
[in]in1variable to be compared with in2.
[in]in2variable to be compared with in1.
Return values
trueif the variables are equal.
falseif not.

◆ ifapi_TPM2B_PUBLIC_KEY_RSA_cmp()

bool ifapi_TPM2B_PUBLIC_KEY_RSA_cmp ( TPM2B_PUBLIC_KEY_RSA *  in1,
TPM2B_PUBLIC_KEY_RSA *  in2 
)

Compare two variables of type TPM2B_PUBLIC_KEY_RSA.

Parameters
[in]in1variable to be compared with in2
[in]in2variable to be compared with in1
Return values
trueif the variables are equal.
falseif not.

◆ ifapi_tpm_to_fapi_signature()

TSS2_RC ifapi_tpm_to_fapi_signature ( IFAPI_OBJECT sig_key_object,
TPMT_SIGNATURE *  tpm_signature,
uint8_t **  signature,
size_t *  signatureSize 
)

Compute signature as byte array and signature size in DER format.

For ECC signatures the conversion to DER is necessary, for RSA the buffer of the TPM2B has already DER format. parameters.

Parameters
[in]sig_key_objectThe signing key.
[in]tpm_signaturethe signature in TPM format.
[out]signatureThe byte array of the signature (callee allocated).
[out]signatureSizeThe size of the byte array.
Return values
TSS2_RC_SUCCESSSif the conversion was successful.
TSS2_FAPI_RC_MEMORYif not enough memory can be allocated.
TSS2_FAPI_RC_GENERAL_FAILUREIf an internal error occurs, which is not covered by other return codes (e.g. a unexpected openssl error).
TSS2_FAPI_RC_BAD_VALUEif an invalid value was passed into the function.
TSS2_FAPI_RC_BAD_REFERENCEa invalid null pointer is passed.

◆ ifapi_TPMS_ECC_POINT_cmp()

bool ifapi_TPMS_ECC_POINT_cmp ( TPMS_ECC_POINT *  in1,
TPMS_ECC_POINT *  in2 
)

Compare two variables of type TPMS_ECC_POINT.

Parameters
[in]in1variable to be compared with in2.
[in]in2variable to be compared with in1.
Return values
trueif the variables are equal.
falseif not.

◆ ifapi_TPMT_PUBLIC_cmp()

bool ifapi_TPMT_PUBLIC_cmp ( TPMT_PUBLIC *  in1,
TPMT_PUBLIC *  in2 
)

Compare the PUBLIC_ID stored in two TPMT_PUBLIC structures.

Parameters
[in]in1the public data with the unique data to be compared with:
[in]in2
Return values
trueif the variables are equal.
falseif not.

◆ ifapi_TPMU_PUBLIC_ID_cmp()

bool ifapi_TPMU_PUBLIC_ID_cmp ( TPMU_PUBLIC_ID *  in1,
UINT32  selector1,
TPMU_PUBLIC_ID *  in2,
UINT32  selector2 
)

Compare two variables of type TPMU_PUBLIC_ID.

Parameters
[in]in1variable to be compared with in2.
[in]selector1key type of first key.
[in]in2variable to be compared with in1.
[in]selector2key type of second key.
Returns
true if variables are equal.
false if not.

◆ init_string_list()

NODE_STR_T * init_string_list ( const char *  string)

Initialize a linked list of strings.

free string in the list object will be set to true. If the list will be extended by sub-string which are part of this strin free_string has to be set to false.

Parameters
[in]stringThe string for the first element.
Return values
theinitial node of the linked list.
NULLif the list cannot be created.

◆ object_with_auth()

bool object_with_auth ( IFAPI_OBJECT object)

Determine whether authentication with an auth value is needed ro an object..

In the key store the information whether an auth value was provided for an object is saved. Thus the it is possible to decide whether the auth value callback is required for authentication.

Parameters
[in]objectThe object which has to be checked..
Return values
trueIf an auth value was provided.
falseIf not.

◆ push_object_to_list()

TSS2_RC push_object_to_list ( void *  object,
NODE_OBJECT_T **  object_list 
)

Add a object as first element to a linked list.

Parameters
[in]objectThe object to be added.
[in,out]object_listThe linked list to be extended.
Return values
TSS2_RC_SUCCESSif the object was added.
TSS2_FAPI_RC_MEMORYIf memory for the list extension cannot be allocated.

◆ split_string()

NODE_STR_T * split_string ( const char *  string,
char *  delimiter 
)

Divides str into substrings based on a delimiter.

Parameters
[in]stringthe string to split.
[in]delimiterthe delimiter.
Return values
Thelinked list of substrings.
NULLif the list cannot be created.

◆ vasprintf()

int vasprintf ( char **  str,
const char *  fmt,
va_list  args 
)

Print to allocated string.

A list of parameters will be printed to an allocated string according to the format description in the first parameter.

Parameters
[out]strThe allocated output string.
[in]fmtThe format string (printf formats can be used.)
[in]argsThe list of objects to be printed.
Return values
intThe size of the string ff the printing was successful.
-1if not enough memory can be allocated.