tpm2-tss
3.2.0
TPM Software stack 2.0 TCG spec compliant implementation
|
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_calculate_pcr_digest (json_object *jso_event_list, const FAPI_QUOTE_INFO *quote_info, TPM2B_DIGEST *pcr_digest) |
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) |
TSS2_RC | ifapi_compute_quote_info (IFAPI_OBJECT *sig_key_object, TPM2B_ATTEST *tpm_quoted, char **quoteInfo) |
TPMS_POLICY * | ifapi_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_nv_get_name (TPM2B_NV_PUBLIC *publicInfo, TPM2B_NAME *name) |
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_T * | init_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_T * | split_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) |
Provides helper functions.
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.
[in,out] | str_list | The linked list. |
[in] | string | The string to be added. |
true | if the string was added to the list. |
false | if the list could not be extended. |
TSS2_RC append_object_to_list | ( | void * | object, |
NODE_OBJECT_T ** | object_list | ||
) |
Add a object as last element to a linked list.
[in] | object | The object to be added. |
[in,out] | object_list | The linked list to be extended. |
TSS2_RC_SUCCESS | if the object was added. |
TSS2_FAPI_RC_MEMORY | If memory for the list extension cannot be allocated. |
void free_string_list | ( | NODE_STR_T * | node | ) |
Free linked list of strings.
[in] | node | the first node of the linked list. |
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.
[out] | str | The allocated output string. |
[in] | fmt | The format string (printf formats can be used.) |
[in] | ... | The list of objects to be printed. |
TSS2_RC_SUCCESS | If the printing was successful. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
TSS2_RC ifapi_calculate_pcr_digest | ( | json_object * | jso_event_list, |
const FAPI_QUOTE_INFO * | quote_info, | ||
TPM2B_DIGEST * | pcr_digest | ||
) |
Check whether a event list corresponds to a certain quote information.
The event list is used to compute the PCR values corresponding to this event list. The PCR digest for these PCRs is computed and compared with the attest passed with quote_info.
[in] | jso_event_list | The event list in JSON representation. |
[in] | quote_info | The information structure with the attest. |
[out] | pcr_digest | The computed pcr_digest for the PCRs uses by FAPI. |
TSS2_RC_SUCCESS | If the PCR digest from the event list matches the PCR digest passed with the quote_info. |
TSS2_FAPI_RC_SIGNATURE_VERIFICATION_FAILED | If the digest computed from event list does not match the attest |
TSS2_FAPI_RC_BAD_VALUE | If inappropriate values are detected in the input data. |
TSS2_FAPI_RC_GENERAL_FAILURE | if an internal error occurred. |
TSS2_FAPI_RC_BAD_REFERENCE | a invalid null pointer is passed. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
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.
[in] | path | The path used for the NV object. |
[out] | nv_index | The NV index to be used. |
TSS2_RC_SUCCESS | If the index for the path can be determined. |
TSS2_FAPI_RC_BAD_PATH | If the path is not valid. |
TSS2_FAPI_RC_BAD_VALUE | If the nv index is not appropriate for the path. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
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.
[in] | pcr_profile | The pcr profile to use as basis for the selection. |
[in] | pcr_capablity | The PCR capabilities available for TPM. |
TSS2_RC_SUCCESSS | if the conversion was successful. |
TSS2_FAPI_RC_BAD_VALUE | if profile is not subset of capabilities. |
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).
[in] | policy | The policy to be cleaned up. |
bool ifapi_cmp_public_key | ( | TPM2B_PUBLIC * | key1, |
TPM2B_PUBLIC * | key2 | ||
) |
Compare two public keys.
[in] | key1 | The first key. |
[in] | key2 | The second key. |
true | if equal false if not. |
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.
[in] | pcrs | The list of PCR values. |
[out] | pcr_selection | The selection computed based on the list of PCR values. |
[in] | hash_alg | The hash algorithm which is used for the policy computation. |
[out] | pcr_digest | The computed PCR digest corresponding to the passed PCR value list. |
TSS2_RC_SUCCESS | if the PCR selection and the PCR digest could be computed.. |
TSS2_FAPI_RC_BAD_VALUE | If inappropriate values are detected in the input data. |
TSS2_FAPI_RC_BAD_REFERENCE | a invalid null pointer is passed. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
TSS2_FAPI_RC_GENERAL_FAILURE | if an internal error occurred. |
TSS2_RC ifapi_compute_quote_info | ( | IFAPI_OBJECT * | sig_key_object, |
TPM2B_ATTEST * | tpm_quoted, | ||
char ** | quoteInfo | ||
) |
Compute the JSON representation of quote information.
The attest generated by a TPM quote will be converted into a JSON representation together with the signature scheme of the key used for the quote.
[in] | sig_key_object | The key object which was used for the quote. |
[in] | tpm_quoted | The attest produced by the quote. |
[out] | quoteInfo | The character string with the JSON representation of the attest together with the signing schemed. |
TSS2_RC_SUCCESS | If the conversion was successful. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
TSS2_FAPI_RC_BAD_VALUE | If an invalid value is detected during serialisation. |
Possible | error codes of the unmarshaling function. |
TSS2_FAPI_RC_GENERAL_FAILURE | if an internal error occurred. |
TSS2_FAPI_RC_BAD_REFERENCE | a invalid null pointer is passed. |
TPMS_POLICY * ifapi_copy_policy | ( | const TPMS_POLICY * | from_policy | ) |
Copy policy.
[in] | from_policy | the policy to be copied. |
The | new policy or NULL if not enough memory was available. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
TSS2_FAPI_RC_BAD_REFERENCE | a invalid null pointer is passed. |
TSS2_RC ifapi_create_dirs | ( | const char * | supdir, |
const char * | path | ||
) |
Create sub-directories in a certain directory.
[in] | supdir | The directory in which the new directories shall be created. |
[in] | path | The path containing one or more sub-directories. |
TSS2_RC_SUCCESS | If the directories were created. |
TSS2_FAPI_RC_MEMORY | If the linked list with the sub-directories cannot be allocated. |
TSS2_FAPI_RC_BAD_VALUE | If a directory cannot be created. |
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.
[in,out] | vpcr | The old and the new PCR value. |
[in] | bank | The bank corresponding to value of the event list which will be used for computation. |
[in] | event | The event list with the values which were extended for a certain bank. |
TSS2_FAPI_RC_BAD_VALUE | if the bank was not found in the event list. |
TSS2_FAPI_RC_GENERAL_FAILURE | if an error occurs in the crypto library |
TSS2_FAPI_RC_BAD_REFERENCE | a invalid null pointer is passed. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
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.
[in,out] | pcr_selection | The pcr selection to be filtered. |
[in] | pcr_index | The only PCR to remain selected. |
[in] | pcr_count | The size of the pcr list. |
TSS2_RC_SUCCESS | if the filtering was successful. |
TSS2_FAPI_RC_BAD_VALUE | if no pcr remain selected or the pcr selection is malformed. |
void ifapi_free_node_list | ( | NODE_OBJECT_T * | node | ) |
Free linked list of IFAPI objects (link nodes only).
[in] | node | the first node of the linked list. |
void ifapi_free_object_list | ( | NODE_OBJECT_T * | node | ) |
Free linked list of IFAPI objects.
[in] | node | the first node of the linked list. |
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.
[in] | url | The url of the resource. |
[out] | buffer | The buffer retrieved via the url. |
[out] | buffer_size | The size of the retrieved object. |
0 | if buffer could be retrieved. |
-1 | if an error did occur |
ESYS_TR ifapi_get_hierary_handle | ( | const char * | path | ) |
Get ESYS handle for a hierarchy path.
[in] | path | The path to be checked. |
The | ESAPI handle for the hierarchy defined in path. |
0 | if not handle can be assigned. |
TSS2_RC ifapi_get_name | ( | TPMT_PUBLIC * | publicInfo, |
TPM2B_NAME * | name | ||
) |
Compute the name of a TPM transient or persistent object.
[in] | publicInfo | The public information of the TPM object. |
[out] | name | The computed name. |
TPM2_RC_SUCCESS | or 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_REFERENCE | a invalid null pointer is passed. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
TSS2_FAPI_RC_BAD_VALUE | if an invalid value was passed into the function. |
TSS2_FAPI_RC_GENERAL_FAILURE | if an internal error occurred. |
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.
[in] | path | The path used for the NV object. |
[out] | start_nv_index | The first possible NV index for this type. |
TSS2_RC_SUCCESS | If the index for the path can be determined. |
TSS2_FAPI_RC_BAD_PATH | If no handle can be assigned. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
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.
[in] | quoteInfo | The JSON representation if the quote information. |
[out] | tpm_quoted | The marhaled version of the attest structure. |
[out] | fapi_quote_info | The quote information structure used by FAPI. |
TSS2_RC_SUCCESS | If the deserialization was successful. |
TSS2_FAPI_RC_BAD_VALUE | If an invalid value is detected during deserialisation. |
Possible | error codes of the marshaling function. |
TSS2_FAPI_RC_BAD_REFERENCE | a invalid null pointer is passed. |
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.
[in] | path | The path to be checked. |
true | if the path describes a hierarchy. |
false | if not. |
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.
[in,out] | hierarchy | The caller allocated hierarchy object. The name of the object will be computed. |
[in] | esys_handle | The ESAPI handle of the hierarchy which will be added to to the object. |
ifapi_null_primary_p | ( | const char * | path | ) |
Determine whether path is a primary in the null hierarchy.
[in] | path | The path to be checked. |
true | if the path describes a null hierarchy primary. |
false | if not. |
TSS2_RC ifapi_nv_get_name | ( | TPM2B_NV_PUBLIC * | publicInfo, |
TPM2B_NAME * | name | ||
) |
Compute the name from the public data of a NV index.
The name of a NV index is computed as follows: name = nameAlg||Hash(nameAlg,marshal(publicArea))
[in] | publicInfo | The public information of the NV index. |
[out] | name | The computed name. |
TSS2_RC_SUCCESS | on success. |
TSS2_FAPI_RC_MEMORY | Memory can not be allocated. |
TSS2_FAPI_RC_BAD_VALUE | for invalid parameters. |
TSS2_FAPI_RC_BAD_REFERENCE | for unexpected NULL pointer parameters. |
TSS2_FAPI_RC_GENERAL_FAILURE | for errors of the crypto library. |
TSS2_SYS_RC_* | for SAPI errors. |
TSS2_RC ifapi_object_cmp_name | ( | IFAPI_OBJECT * | object, |
void * | name, | ||
bool * | equal | ||
) |
Check whether a nv or key object has a certain name.
[in] | object | The object (has to be checked whether it's a key). |
[in] | name | The name to be compared. |
[out] | equal | If the two names are equal. |
TSS2_RC_SUCCESSS | if name of object can be deserialized. |
TSS2_FAPI_RC_BAD_REFERENCE | a invalid null pointer is passed. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
TSS2_FAPI_RC_BAD_VALUE | if an invalid value was passed into the function. |
TSS2_FAPI_RC_GENERAL_FAILURE | if an internal error occurred. |
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.
[in] | object | The object (has to be checked whether it's a key). |
[in] | nv_public | The NV public data with the NV index. |
[out] | equal | If the two names are equal. |
TSS2_RC_SUCCESSS | if name of object can be deserialized. |
size_t ifapi_path_length | ( | NODE_STR_T * | node | ) |
Compute the number on nodes in a linked list.
[in] | node | the first node of the linked list. |
the | number on nodes. |
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.
[out] | dest | The pointer to the generated pathname (callee allocated). |
[in] | supdir | A sup directory will be the prefix of the pathname. |
[in] | node | The linked list. |
[in] | name | A name which is appended to the result if not NULL. |
TSS2_RC_SUCCESS | if the function call was a success. |
TSS2_FAPI_RC_MEMORY | if the memory for the pathname can't be allocated. |
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.
[out] | dest | the pointer to the pathname (callee allocated). |
[in] | supdir | a sup directory will be the prefix of the pathname. (can be NULL). |
[in] | node | the linked list. |
[in] | name | the filename (can be NULL). |
[in] | n | the number of the first elements which will bes used for concatenation. |
TSS2_RC_SUCCESS | if the function call was a success. |
TSS2_FAPI_RC_MEMORY | if the memory for the pathname can't be allocated. |
bool ifapi_path_type_p | ( | const char * | path, |
const char * | type | ||
) |
Determine whether path is of certain type.
[in] | path | The path to be checked. |
[in] | type | sub-string at the beginning of the path to be checked. |
true | if the path name starts with type. |
false | if not. |
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.
[in] | type | The flags describing the key type. |
[in] | policy | The flag whether a policy is used. |
[out] | template | The template including the TPM2B_PUBLIC which will be used for key creation. |
TSS2_RC_SUCCESS | if the template can be generated. |
TSS2_FAPI_RC_BAD_VALUE | If an invalid combination of flags was used. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
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.
[in] | type | The flags describing the nv object type. |
[in] | policy | The flag whether a policy is used. |
[out] | template | The template including the TPM2B_NV_PUBLIC which will be used for nv object creation. |
TSS2_RC_SUCCESS | if the template can be generated. |
TSS2_FAPI_RC_BAD_VALUE | If an invalid combination of flags was used. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
bool ifapi_TPM2B_DIGEST_cmp | ( | TPM2B_DIGEST * | in1, |
TPM2B_DIGEST * | in2 | ||
) |
Compare two variables of type TPM2B_DIGEST.
[in] | in1 | variable to be compared with in2. |
[in] | in2 | variable to be compared with in1. |
true | if the variables are equal. |
false | if not. |
bool ifapi_TPM2B_ECC_PARAMETER_cmp | ( | TPM2B_ECC_PARAMETER * | in1, |
TPM2B_ECC_PARAMETER * | in2 | ||
) |
Compare two variables of type TPM2B_ECC_PARAMETER.
[in] | in1 | variable to be compared with in2. |
[in] | in2 | variable to be compared with in1. |
true | if the variables are equal. |
false | if not. |
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.
[in] | in1 | variable to be compared with in2 |
[in] | in2 | variable to be compared with in1 |
true | if the variables are equal. |
false | if not. |
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.
[in] | sig_key_object | The signing key. |
[in] | tpm_signature | the signature in TPM format. |
[out] | signature | The byte array of the signature (callee allocated). |
[out] | signatureSize | The size of the byte array. |
TSS2_RC_SUCCESSS | if the conversion was successful. |
TSS2_FAPI_RC_MEMORY | if not enough memory can be allocated. |
TSS2_FAPI_RC_GENERAL_FAILURE | If an internal error occurs, which is not covered by other return codes (e.g. a unexpected openssl error). |
TSS2_FAPI_RC_BAD_VALUE | if an invalid value was passed into the function. |
TSS2_FAPI_RC_BAD_REFERENCE | a invalid null pointer is passed. |
bool ifapi_TPMS_ECC_POINT_cmp | ( | TPMS_ECC_POINT * | in1, |
TPMS_ECC_POINT * | in2 | ||
) |
Compare two variables of type TPMS_ECC_POINT.
[in] | in1 | variable to be compared with in2. |
[in] | in2 | variable to be compared with in1. |
true | if the variables are equal. |
false | if not. |
bool ifapi_TPMT_PUBLIC_cmp | ( | TPMT_PUBLIC * | in1, |
TPMT_PUBLIC * | in2 | ||
) |
Compare the PUBLIC_ID stored in two TPMT_PUBLIC structures.
[in] | in1 | the public data with the unique data to be compared with: |
[in] | in2 |
true | if the variables are equal. |
false | if not. |
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.
[in] | in1 | variable to be compared with in2. |
[in] | selector1 | key type of first key. |
[in] | in2 | variable to be compared with in1. |
[in] | selector2 | key type of second key. |
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.
[in] | string | The string for the first element. |
the | initial node of the linked list. |
NULL | if the list cannot be created. |
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.
[in] | object | The object which has to be checked.. |
true | If an auth value was provided. |
false | If not. |
TSS2_RC push_object_to_list | ( | void * | object, |
NODE_OBJECT_T ** | object_list | ||
) |
Add a object as first element to a linked list.
[in] | object | The object to be added. |
[in,out] | object_list | The linked list to be extended. |
TSS2_RC_SUCCESS | if the object was added. |
TSS2_FAPI_RC_MEMORY | If memory for the list extension cannot be allocated. |
NODE_STR_T * split_string | ( | const char * | string, |
char * | delimiter | ||
) |
Divides str into substrings based on a delimiter.
[in] | string | the string to split. |
[in] | delimiter | the delimiter. |
The | linked list of substrings. |
NULL | if the list cannot be created. |
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.
[out] | str | The allocated output string. |
[in] | fmt | The format string (printf formats can be used.) |
[in] | args | The list of objects to be printed. |
int | The size of the string ff the printing was successful. |
-1 | if not enough memory can be allocated. |