ESYS_TR(3)
ESYS_TR(3) π β Esys Tpm Resource ESYS_TR
okay bestie, welcome to the Library Functions Manual page for ESYS_TR β yes the header line said ESYS_TR(3) and the manual is Library Functions Manual, iykyk. This is the resource-handle lore you didn't know you needed. π
β¨ NAME β¨
ESYS_TR β Esys Tpm Resource ESYS_TR. That's the whole name, no cap. It's the little handle that points at all the TPM resource metadata, and we're about to get deep into it. π¦
β¨ SYNOPSIS β¨
πΈ Topics
- Global
ESYS_TRobjects
πΈ 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)
like, that's the whole roster. some of them get their full moment below, some are saving their energy for part 2 π
β¨ 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. π
so like βESYS_TR_NON, PCRs, hierarchies? global. everything fromESYS_TR_MIN_OBJECTupward? not global, that's where the real ones start. π
π TYPEDEF DOCUMENTATION π
π typedef uint32_t 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. β¨
it's giving pointer-to-a-vibe, but make it uint32_t. iconic. π
π₯ 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. π¨
important bestie: this is not a delete-from-TPM button. it's a delete-from-your-context button. transient stuff goes through Esys_FlushContext, periodt.
Parameters
esys_context[in,out]β TheESYS_CONTEXTobject[out]βESYS_TRmetadata object to be deleted fromESYS_CONTEXT.
Return values
TSS2_RC_SUCCESSon Success.TSS2_ESYS_RC_BAD_REFERENCEif theesysContextisNULL.TSS2_ESYS_RC_BAD_TRif theESYS_TRobject is unknown to theESYS_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 deserialized using Esys_TR_Deserialize. π
Parameters
esys_context[in,out]β TheESYS_CONTEXT.buffer[in]β The buffer containing the metadata of theESYS_TRobject.buffer_size[in]β The size of thebufferparameter.esys_handle[out]β TheESYS_TRobject to deserialize.
Return values
TSS2_RC_SUCCESSon Success.TSS2_ESYS_RC_MEMORYif the object can not be allocated.TSS2_ESYS_RC_INSUFFICIENT_BUFFERif the buffer for unmarshalling.TSS2_ESYS_RC_BAD_REFERENCEif theesysContextisNULL.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]β TheESYS_CONTEXTtpm_handle[in]β The handle of the TPM object to represent asESYS_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 createdESYS_TRmetadata object.
Return values
TSS2_RC_SUCCESSon successESYS_RC_SUCCESSif the function call was a success.TSS2_ESYS_RC_BAD_REFERENCEif theesysContextor required input pointers or required output handle references areNULL.TSS2_ESYS_RC_BAD_CONTEXTifesysContextcorruption is detected.TSS2_ESYS_RC_MEMORYif the ESAPI cannot allocate enough memory for internal operations or return parameters.TSS2_ESYS_RC_BAD_SEQUENCEif the context has an asynchronous operation already pending.TSS2_ESYS_RC_INSUFFICIENT_RESPONSEif the TPM's response does not at least contain the tag, response length, and response code.TSS2_ESYS_RC_MALFORMED_RESPONSEif the TPM's response is corrupted.TSS2_ESYS_RC_MULTIPLE_DECRYPT_SESSIONSif more than one session has the 'decrypt' attribute bit set.TSS2_ESYS_RC_MULTIPLE_ENCRYPT_SESSIONSif more than one session has the 'encrypt' attribute bit set.TSS2_ESYS_RC_NO_DECRYPT_PARAMif 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. β¨
(yes the summary says "synchronous" and the body says "asynchronous" β that's what the page says, I'm just the messenger bestie π)
Parameters
esys_context[in,out]β TheESYS_CONTEXTtpm_handle[in]β The handle of the TPM object to represent asESYS_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_SUCCESSon successESYS_RC_SUCCESSif the function call was a success.TSS2_ESYS_RC_BAD_REFERENCEif theesysContextisNULL.TSS2_ESYS_RC_BAD_CONTEXTifesysContextcorruption is detected.TSS2_ESYS_RC_MEMORYif the ESAPI cannot allocate enough memory for internal operations or return parameters.TSS2_ESYS_RC_MULTIPLE_DECRYPT_SESSIONSif more than one session has the 'decrypt' attribute bit set.TSS2_ESYS_RC_MULTIPLE_ENCRYPT_SESSIONSif more than one session has the 'encrypt' attribute bit set.TSS2_ESYS_RC_NO_DECRYPT_PARAMif 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]β TheESYS_CONTEXTobject[out]β The newly createdESYS_TRmetadata object.
Return values
TSS2_RC_SUCCESSon successESYS_RC_SUCCESSif the function call was a success.TSS2_ESYS_RC_BAD_REFERENCEif theesysContextor required input pointers or required output handle references areNULL.TSS2_ESYS_RC_BAD_CONTEXTifesysContextcorruption is detected.TSS2_ESYS_RC_MEMORYif the ESAPI cannot allocate enough memory for internal operations or return parameters.TSS2_ESYS_RC_BAD_SEQUENCEif the context has an asynchronous operation already pending.TSS2_ESYS_RC_TRY_AGAINif the timeout counter expires before the TPM response is received.TSS2_ESYS_RC_INSUFFICIENT_RESPONSEif the TPM's response does not at least contain the tag, response length, and response code.TSS2_ESYS_RC_MALFORMED_RESPONSEif 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]β TheESYS_CONTEXT.esys_handle[in,out]β TheESYS_TRfor which to retrieve the name.name[out]β The name of the object (caller-allocated; usefree()).
don't forget the free() bestie, that's your memory now π
Return values
TSS2_RC_SUCCESSon Success.TSS2_ESYS_RC_MEMORYif needed memory can't be allocated.TSS2_ESYS_RC_GENERAL_FAILUREfor errors of the crypto library.TSS2_ESYS_RC_BAD_REFERENCEif theesysContextisNULL.TSS2_ESYS_RC_BAD_TRif the handle is invalid.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 using Esys_TR_Deserialize. π
Parameters
esys_context[in,out]β TheESYS_CONTEXT.esys_handle[in]β TheESYS_TRobject to serialize.buffer[out]β The buffer containing the serialized metadata. (caller-callocated) Shall be freed usingfree().buffer_size[out]β The size of thebufferparameter.
Return values π
Okay so for the function we were just talking about, hereβs the return-value menu, no cap:
TSS2_RC_SUCCESSβ on Success.TSS2_ESYS_RC_BAD_TRβ if theESYS_TRobject is unknown to theESYS_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_RCsproduced by lower layers of the software stack.
Esys_TR_SetAuth β the auth-value glow-up π
TSS2_RC Esys_TR_SetAuth (ESYS_CONTEXT * esys_context, ESYS_TR esys_handle, TPM2B_AUTH const * authValue)
Sets the authorization value of an ESYS_TR β literally giving it the auth it needs to be its main character. β¨
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 duringEsys_TR_Serialize. ThereforEsys_TR_SetAuthneeds to be called again after everyEsys_TR_Deserialize.
Parameters
esys_context[in,out]β TheESYS_CONTEXT.esys_handle[in,out]β TheESYS_TRfor which to set the auth value.authValue[in]β The auth value to set for theESYS_TRorNULLto zero the auth.
Return values
TSS2_RC_SUCCESSβ on Success.TSS2_ESYS_RC_BAD_REFERENCEβ if theesysContextisNULL.TSS2_ESYS_RC_BAD_TRβ if theESYS_TRobject is unknown to theESYS_CONTEXTor it equalsESYS_TR_NONE.
Esys_TRSess_GetAttributes β session attributes peek π
TSS2_RC Esys_TRSess_GetAttributes (ESYS_CONTEXT * esys_context, ESYS_TR esys_handle, TPMA_SESSION * flags)
Retrieves the session attributes of the ESYS_TR session. π
Sessions possess attributes, such as whether they shall continue or 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.
Bestie, this is session-only business β no cap. If the ESYS_TR isnβt a session object, itβs giving βwrong room, wrong vibe.β π
Parameters
esys_context[in,out]β TheESYS_CONTEXT.esys_handle[in,out]β TheESYS_TRof the session.flags[out]β The attributes of the session.
Return values
TSS2_ESYS_RC_BAD_REFERENCEβ if theesysContextisNULL.TSS2_ESYS_RC_BAD_TRβ if theESYS_TRobject is unknown to theESYS_CONTEXTorESYS_TRobject is not a session object.
Esys_TRSess_SetAttributes β session attributes remix ποΈ
TSS2_RC Esys_TRSess_SetAttributes (ESYS_CONTEXT * esys_context, ESYS_TR esys_handle, TPMA_SESSION flags, TPMA_SESSION mask)
Sets session attributes. Set or unset a sessionβs attributes according to the provided flags and mask. Itβs basically a little bit-math makeover for your session β iconic. π
new_attributes = old_attributes & ~mask | flags & mask
Note: this function only applies to ESYS_TR objects that represent sessions.
Parameters
esys_context[in,out]β TheESYS_CONTEXT.esys_handle[in,out]β TheESYS_TRof 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 theesysContextisNULL.TSS2_ESYS_RC_BAD_TRβ if theESYS_TRobject is unknown to theESYS_CONTEXTorESYS_TRobject is not a session object.
Author β¨
Generated automatically by Doxygen for tpm2-tss from the source code. Auto-generated lore, fr fr. π«Ά
Thatβs the whole page, bestie β source tpm2-tss, version 4.1.5, and the footerβs date/page moment is the usual ESYS_TR(3) situation. Catch you in the next manpage! πβ¨π¦
π¦ where this page comes from
- fedora 44: tpm2-tss-devel 4.1.5-1.fc44 Β· BSD-2-Clause
- fedora 44: tpm2-tss-devel 4.1.5-1.fc44 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms