ESYS_TR man page

ESYS_TR

Synopsis

Modules

Global Esys_tr objects

Typedefs

typedef uint32_t Esys_tr

Functions

TSS2_RC Esys_TR_SetAuth (ESYS_CONTEXT *esysContext, Esys_tr handle, TPM2B_AUTH const *authValue)
TSS2_RC Esys_TR_GetName (ESYS_CONTEXT *esysContext, Esys_tr handle, TPM2B_NAME **name)
TSS2_RC Esys_TR_FromTPMPublic_Async (ESYS_CONTEXT *esysContext, TPM2_HANDLE tpm_handle, Esys_tr optionalSession1, Esys_tr optionalSession2, Esys_tr optionalSession3)
TSS2_RC Esys_TR_FromTPMPublic_Finish (ESYS_CONTEXT *esysContext, Esys_tr *object)
TSS2_RC Esys_TR_FromTPMPublic (ESYS_CONTEXT *esysContext, TPM2_HANDLE tpm_handle, Esys_tr optionalSession1, Esys_tr optionalSession2, Esys_tr optionalSession3, Esys_tr *object)
TSS2_RC Esys_TR_Serialize (ESYS_CONTEXT *esys_context, Esys_tr object, uint8_t **buffer, size_t *buffer_size)
TSS2_RC Esys_TR_Deserialize (ESYS_CONTEXT *esys_context, uint8_t const *buffer, size_t buffer_size, Esys_tr *esys_handle)
TSS2_RC Esys_TR_Close (ESYS_CONTEXT *esys_context, Esys_tr *rsrc_handle)
TSS2_RC Esys_TRSess_GetAttributes (ESYS_CONTEXT *esysContext, Esys_tr session, TPMA_SESSION *flags)
TSS2_RC Esys_TRSess_SetAttributes (ESYS_CONTEXT *esysContext, Esys_tr session, TPMA_SESSION flags, TPMA_SESSION mask)

Detailed Description

Virtual objects with meta data for Tpm Resources. The Esys TPM Resources are the virtual objects inside the ESYSCONTEXT that hold the metadata for corresponding TPM Resources.

There are a set of global Esys_tr objects such as ESYS_TR_NON or for the various PCRs and hierarchies. ESYS_TR_MIN_OBJECT denotes the first non-global Esys_tr object.

Typedef Documentation

Esys_tr

Reference to the virtual object inside the ESYS_CONTEXT that holds the metadata for the corresponding TPM Resource. Such can be Transient key, Persistent objects, NV spaces, Sessions or PCRs.

Function Documentation

TSS2_RC Esys_TR_Close (ESYS_CONTEXT * esys_context, ESYS_TR * object)

Close an Esys_tr without removing it from the TPM.

This function deletes an Esys_tr object from an ESYS_CONTEXT without deleting it from the TPM. This is useful for NV-Indices or persistent keys, after Esys_TR_Serialize has been called. Transient objects should be deleted using Esys_FlushContext.

Parameters:

esys_context [in,out] The ESYS_CONTEXT
object [out] Esys_tr metadata object to be deleted from ESYS_CONTEXT.

Return values:

TSS2_RC_SUCCESS on Success.
TSS2_ESYS_RC_BAD_REFERENCE if the esysContext is NULL.
TSS2_ESYS_RC_BAD_TR if the Esys_tr object is unknown to the ESYS_CONTEXT.

TSS2_RC Esys_TR_Deserialize (ESYS_CONTEXT * esys_context, uint8_t const * buffer, size_t buffer_size, ESYS_TR * esys_handle)

Deserialization of an Esys_tr from a byte buffer.

Deserialize the metadata of an Esys_tr object from a byte buffer that was stored on disk for later use by a different program or context. An object can be serialized suing Esys_TR_Serialize.

Parameters:

esys_context [in,out] The ESYS_CONTEXT.
esys_handle [in] The Esys_tr object to serialize.
buffer [out] The buffer containing the serialized metadata. (caller-callocated) Shall be freed using free().
buffer_size [out] The size of the buffer parameter.

Return values:

TSS2_RC_SUCCESS on Success.
TSS2_ESYS_RC_MEMORY if the object can not be allocated.
TSS2_ESYS_RC_INSUFFICIENT_BUFFER if the buffer for unmarshaling.
TSS2_ESYS_RC_BAD_REFERENCE if the esysContext is NULL.
TSS2_RCs produced by lower layers of the software stack.

TSS2_RC Esys_TR_FromTPMPublic (ESYS_CONTEXT * esys_context, TPM2_HANDLE tpm_handle, ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3, ESYS_TR * object)

Creation of an Esys_tr object from TPM metadata.

This function can be used to create Esys_tr object for Tpm Resources that are not created or loaded (e.g. using ESys_CreatePrimary or ESys_Load) but pre-exist inside the TPM. Examples are NV-Indices or persistent object.

Note: For PCRs and hierarchies, please use the global Esys_tr identifiers. Note: If a session is provided the TPM is queried for the metadata twice. First without a session to retrieve some metadata then with the session where this metadata is used in the session HMAC calculation and thereby verified.

Since man in the middle attacks should be prevented as much as possible it is recommended to pass a session.

Parameters:

esys_context [in,out] The ESYS_CONTEXT
tpm_handle [in] The handle of the TPM object to represent as Esys_tr.
shandle1 [in,out] A session for securing the TPM command (optional).
shandle2 [in,out] A session for securing the TPM command (optional).
shandle3 [in,out] A session for securing the TPM command (optional).
object [out] The newly created Esys_tr metadata object.

Return values:

TSS2_RC_SUCCESS on success
ESYS_RC_SUCCESS if the function call was a success.
TSS2_ESYS_RC_BAD_REFERENCE if the esysContext or required input pointers or required output handle references are NULL.
TSS2_ESYS_RC_BAD_CONTEXT if esysContext corruption is detected.
TSS2_ESYS_RC_MEMORY if the ESAPI cannot allocate enough memory for internal operations or return parameters.
TSS2_ESYS_RC_BAD_SEQUENCE if the context has an asynchronous operation already pending.
TSS2_ESYS_RC_INSUFFICIENT_RESPONSE if the TPM's response does not at least contain the tag, response length, and response code.
TSS2_ESYS_RC_MALFORMED_RESPONSE if the TPM's response is corrupted.
TSS2_ESYS_RC_MULTIPLE_DECRYPT_SESSIONS if more than one session has the 'decrypt' attribute bit set.
TSS2_ESYS_RC_MULTIPLE_ENCRYPT_SESSIONS if more than one session has the 'encrypt' attribute bit set.
TSS2_ESYS_RC_NO_DECRYPT_PARAM if one of the sessions has the 'decrypt' attribute set and the command does not support encryption of the first command parameter.
TSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.

TSS2_RC Esys_TR_FromTPMPublic_Async (ESYS_CONTEXT * esys_context, TPM2_HANDLE tpm_handle, ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3)

Start synchronous creation of an Esys_tr object from TPM metadata.

This function starts the asynchronous retrieval of metadata from the TPM in order to create a new Esys_tr object.

Parameters:

esys_context [in,out] The ESYS_CONTEXT
tpm_handle [in] The handle of the TPM object to represent as Esys_tr.
shandle1 [in,out] A session for securing the TPM command (optional).
shandle2 [in,out] A session for securing the TPM command (optional).
shandle3 [in,out] A session for securing the TPM command (optional).

Return values:

TSS2_RC_SUCCESS on success
ESYS_RC_SUCCESS if the function call was a success.
TSS2_ESYS_RC_BAD_REFERENCE if the esysContext is NULL.
TSS2_ESYS_RC_BAD_CONTEXT if esysContext corruption is detected.
TSS2_ESYS_RC_MEMORY if the ESAPI cannot allocate enough memory for internal operations or return parameters.
TSS2_ESYS_RC_MULTIPLE_DECRYPT_SESSIONS if more than one session has the 'decrypt' attribute bit set.
TSS2_ESYS_RC_MULTIPLE_ENCRYPT_SESSIONS if more than one session has the 'encrypt' attribute bit set.
TSS2_ESYS_RC_NO_DECRYPT_PARAM if one of the sessions has the 'decrypt' attribute set and the command does not support encryption of the first command parameter.
TSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.

TSS2_RC Esys_TR_FromTPMPublic_Finish (ESYS_CONTEXT * esys_context, ESYS_TR * object)

Finish asynchronous creation of an Esys_tr object from TPM metadata.

This function finishes the asynchronous retrieval of metadata from the TPM in order to create a new Esys_tr object.

Parameters:

esys_context [in,out] The ESYS_CONTEXT
object [out] The newly created Esys_tr metadata object.

Return values:

TSS2_RC_SUCCESS on success
ESYS_RC_SUCCESS if the function call was a success.
TSS2_ESYS_RC_BAD_REFERENCE if the esysContext or required input pointers or required output handle references are NULL.
TSS2_ESYS_RC_BAD_CONTEXT if esysContext corruption is detected.
TSS2_ESYS_RC_MEMORY if the ESAPI cannot allocate enough memory for internal operations or return parameters.
TSS2_ESYS_RC_BAD_SEQUENCE if the context has an asynchronous operation already pending.
TSS2_ESYS_RC_TRY_AGAIN if the timeout counter expires before the TPM response is received.
TSS2_ESYS_RC_INSUFFICIENT_RESPONSE if the TPM's response does not at least contain the tag, response length, and response code.
TSS2_ESYS_RC_MALFORMED_RESPONSE if the TPM's response is corrupted.
TSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.

TSS2_RC Esys_TR_GetName (ESYS_CONTEXT * esys_context, ESYS_TR esys_handle, TPM2B_NAME ** name)

Retrieve the TPM public name of an Esys_TR object.

Some operations (i.e. Esys_PolicyNameHash) require the name of a TPM object to be passed. Esys_TR_GetName provides this name to the caller.

Parameters:

esys_context [in,out] The ESYS_CONTEXT.
esys_handle [in,out] The Esys_tr for which to retrieve the name.
name [out] The name of the object (caller-allocated; use free()).

Return values:

TSS2_RC_SUCCESS on Success.
TSS2_ESYS_RC_MEMORY if needed memory can't be allocated.
TSS2_ESYS_RC_GENERAL_FAILURE for errors of the crypto library.
TSS2_ESYS_RC_BAD_REFERENCE if the esysContext is NULL.
TSS2_SYS_RC_* for SAPI errors.

TSS2_RC Esys_TR_Serialize (ESYS_CONTEXT * esys_context, ESYS_TR esys_handle, uint8_t ** buffer, size_t * buffer_size)

Serialization of an Esys_tr into a byte buffer.

Serialize the metadata of an Esys_tr object into a byte buffer such that it can be stored on disk for later use by a different program or context. The serialized object can be deserialized suing Esys_TR_Deserialize.

Parameters:

esys_context [in,out] The ESYS_CONTEXT.
esys_handle [in] The Esys_tr object to serialize.
buffer [out] The buffer containing the serialized metadata. (caller-callocated) Shall be freed using free().
buffer_size [out] The size of the buffer parameter.

Return values:

TSS2_RC_SUCCESS on Success.
TSS2_ESYS_RC_BAD_TR if the Esys_tr object is unknown to the ESYS_CONTEXT.
TSS2_ESYS_RC_MEMORY if the buffer for marshaling the object can't be allocated.
TSS2_ESYS_RC_BAD_VALUE For invalid ESYS data to be marshaled.
TSS2_RCs produced by lower layers of the software stack.

TSS2_RC Esys_TR_SetAuth (ESYS_CONTEXT * esys_context, ESYS_TR esys_handle, TPM2B_AUTH const * authValue)

Set the authorization value of an Esys_tr.

Authorization values are associated with Esys_tr Tpm Resource object. They are then picked up whenever an authorization is needed.

Note: The authorization value is not stored in the metadata during Esys_TR_Serialize. Therefor Esys_TR_SetAuth needs to be called again after every Esys_TR_Deserialize.

Parameters:

esys_context [in,out] The ESYS_CONTEXT.
esys_handle [in,out] The Esys_tr for which to set the auth value.
authValue [in] The auth value to set for the Esys_tr or NULL to zero the auth.

Return values:

TSS2_RC_SUCCESS on Success.
TSS2_ESYS_RC_BAD_REFERENCE if the esysContext is NULL.
TSS2_ESYS_RC_BAD_TR if the Esys_tr object is unknown to the ESYS_CONTEXT.

TSS2_RC Esys_TRSess_GetAttributes (ESYS_CONTEXT * esys_context, ESYS_TR esys_handle, TPMA_SESSION * flags)

Retrieve the Session Attributes of the Esys_tr session.

Sessions possess attributes, such as whether they shall continue of be flushed after the next command, or whether they are used to encrypt parameters. Note: this function only applies to Esys_tr objects that represent sessions.

Parameters:

esys_context [in,out] The ESYS_CONTEXT.
esys_handle [in,out] The Esys_tr of the session.
flags [out] The attributes of the session.

Return values:

TSS2_ESYS_RC_BAD_REFERENCE if the esysContext is NULL.
TSS2_ESYS_RC_BAD_TR if the Esys_tr object is unknown to the ESYS_CONTEXT or Esys_tr object is not a session object.

TSS2_RC Esys_TRSess_SetAttributes (ESYS_CONTEXT * esys_context, ESYS_TR esys_handle, TPMA_SESSION flags, TPMA_SESSION mask)

Set session attributes

Set or unset a session's attributes according to the provided flags and mask.

new_attributes = old_attributes & ~mask | flags & mask 

Note: this function only applies to Esys_tr objects that represent sessions.

Parameters:

esys_context [in,out] The ESYS_CONTEXT.
esys_handle [in,out] The Esys_tr of the session.
flags [in] The flags to be set or unset for the session.
mask [in] The mask for the flags to be set or unset.

Return values:

TSS2_RC_SUCCESS on Success.
TSS2_ESYS_RC_BAD_REFERENCE if the esysContext is NULL.
TSS2_ESYS_RC_BAD_TR if the Esys_tr object is unknown to the ESYS_CONTEXT or Esys_tr object is not a session object.

Author

Generated automatically by Doxygen for tpm2-tss from the source code.

Info

Fri Sep 6 2019 Version 2.3.1 tpm2-tss