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β TheESYS_CONTEXT.contextβ The context blob.loadedHandleβESYS_TRhandle of ESYS resource forTPMI_DH_CONTEXT.
Return values
TSS2_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_RSP_AUTH_FAILEDif 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 aNULLwhere a required pointer belongs, that's aTSS2_ESYS_RC_BAD_REFERENCEand 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β TheESYS_CONTEXT.contextβ The context blob.
Return values
ESYS_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_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β TheESYS_CONTEXT.loadedHandleβESYS_TRhandle of ESYS resource forTPMI_DH_CONTEXT.
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_RSP_AUTH_FAILEDif the response HMAC from the TPM did not verify.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_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
- 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