Esys_ContextLoad(3)

πŸ’… Esys_ContextLoad(3) β€” the girlies' guide to TPM2_ContextLoad

okay so bestie, this is a page from the Library Functions Manual of tpm2-tss, and it's literally all about the ESAPI function that runs the TPM2_ContextLoad command. no cap, it's giving "load that context blob back into the TPM" energy. let's get into it 🫢


✨ NAME ✨

Esys_ContextLoad β€” the ESAPI function for the TPM2_ContextLoad command. that's it, that's the vibe πŸ’–


✨ SYNOPSIS ✨

πŸ¦‹ Functions

TSS2_RC Esys_ContextLoad_Async (ESYS_CONTEXT *esysContext, const
    TPMS_CONTEXT *context)
TSS2_RC Esys_ContextLoad (ESYS_CONTEXT *esysContext, const TPMS_CONTEXT
    *context, ESYS_TR *loadedHandle)
TSS2_RC Esys_ContextLoad_Finish (ESYS_CONTEXT *esysContext, ESYS_TR
    *loadedHandle)

✨ Detailed Description ✨

ESAPI function to invoke the TPM2_ContextLoad command either as a one-call or in an asynchronous manner. so like, you can do it in one go and wait for it, or yeet it down the stack and finish it later. both are iconic, just different vibes 🌈


✨ Function Documentation ✨

πŸŽ€ TSS2_RC Esys_ContextLoad (ESYS_CONTEXT * esysContext, const TPMS_CONTEXT * context, ESYS_TR * loadedHandle)

One-Call function for TPM2_ContextLoad πŸ‘‘

This function invokes the TPM2_ContextLoad command in a one-call variant. This means the function will block until the TPM response is available. All input parameters are const. The memory for non-simple output parameters is allocated by the function implementation.

like literally it just sits there and waits for the TPM to reply, no thoughts head empty, just blocking until the response shows up. all the input params are const, and if an output parameter isn't "simple", the function itself handles allocating the memory for it. main character energy fr fr πŸ’…

Parameters

  • esysContext β€” The ESYS_CONTEXT.
  • context β€” The context blob.
  • loadedHandle β€” ESYS_TR handle of ESYS resource for TPMI_DH_CONTEXT.

Return values

  • TSS2_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_RSP_AUTH_FAILED if the response HMAC from the TPM did not verify.
  • TSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.
ngl if you pass a NULL where a required pointer belongs, that's a TSS2_ESYS_RC_BAD_REFERENCE and the function is gonna be like "girl. no." 😭

πŸŽ€ TSS2_RC Esys_ContextLoad_Async (ESYS_CONTEXT * esysContext, const TPMS_CONTEXT * context)

Asynchronous function for TPM2_ContextLoad πŸ¦‹

This function invokes the TPM2_ContextLoad command in a asynchronous variant. This means the function will return as soon as the command has been sent downwards the stack to the TPM. All input parameters are const. In order to retrieve the TPM's response call Esys_ContextLoad_Finish.

so real, this one does not wait around β€” it sends the command down the stack and dips immediately. all input params are const. to actually get the TPM's response you gotta call Esys_ContextLoad_Finish, okay? don't forget the finish part, that's the whole plot twist ✨

Parameters

  • esysContext β€” The ESYS_CONTEXT.
  • context β€” The context blob.

Return values

  • 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_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.

πŸŽ€ TSS2_RC Esys_ContextLoad_Finish (ESYS_CONTEXT * esysContext, ESYS_TR * loadedHandle)

Asynchronous finish function for TPM2_ContextLoad 🌸

This function returns the results of a TPM2_ContextLoad command invoked via Esys_ContextLoad_Finish. All non-simple output parameters are allocated by the function's implementation. NULL can be passed for every output parameter if the value is not required.

this is the part where you actually collect the results from the async call. non-simple output params get allocated by the implementation, and bestie, you can pass NULL for any output parameter you don't care about β€” it's literally fine, no pressure πŸ’–

Parameters

  • esysContext β€” The ESYS_CONTEXT.
  • loadedHandle β€” ESYS_TR handle of ESYS resource for TPMI_DH_CONTEXT.

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_RSP_AUTH_FAILED if the response HMAC from the TPM did not verify.
  • 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_ESYS_RC_TRY_AGAIN is giving "the timeout counter expired before the TPM response arrived" β€” not a skill issue, just try again later πŸ’€

✨ Author ✨

Generated automatically by Doxygen for tpm2-tss from the source code. so no, a human didn't hand-write this, the docs tooling did it and honestly it ate πŸ‘‘


and that's the whole page, bestie!! πŸŽ€ this was tpm2-tss Version 4.1.5, brought to you by the tpm2-tss girlies and their automatic Doxygen generation. slay, stay safe, and always finish your async calls πŸ’œβœ¨

πŸ“¦ where this page comes from