Esys_StartAuthSession(3)

✨ Esys_StartAuthSession(3) ✨

okay bestie so this page is straight out of the Library Functions Manual, and it's literally the whole ESAPI glow-up for the TPM2_StartAuthSession command. it's giving "let's open a session with the TPM" and honestly? iconic. no cap, everything you need is right here πŸ’…


πŸŽ€ NAME πŸŽ€

Esys_StartAuthSession β€” the ESAPI function for the TPM2_StartAuthSession command. periodt.


🌸 SYNOPSIS 🌸

Functions

TSS2_RC Esys_StartAuthSession_Async (ESYS_CONTEXT *esysContext, ESYS_TR
    tpmKey, ESYS_TR bind, ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR
    shandle3, const TPM2B_NONCE *nonceCaller, TPM2_SE sessionType, const
    TPMT_SYM_DEF *symmetric, TPMI_ALG_HASH authHash)
TSS2_RC Esys_StartAuthSession (ESYS_CONTEXT *esysContext, ESYS_TR
    tpmKey, ESYS_TR bind, ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR
    shandle3, const TPM2B_NONCE *nonceCaller, TPM2_SE sessionType, const
    TPMT_SYM_DEF *symmetric, TPMI_ALG_HASH authHash, ESYS_TR
    *sessionHandle)
TSS2_RC Esys_StartAuthSession_Finish (ESYS_CONTEXT *esysContext, ESYS_TR
    *sessionHandle)

πŸ¦‹ Detailed Description πŸ¦‹

it's the ESAPI function for invoking the TPM2_StartAuthSession command β€” and you get to pick your vibe: either the one-call route, or the asynchronous route. choose your fighter 🫢


πŸ’– Function Documentation πŸ’–

⭐ TSS2_RC Esys_StartAuthSession (ESYS_CONTEXT * esysContext, ESYS_TR tpmKey, ESYS_TR bind, ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3, const TPM2B_NONCE * nonceCaller, TPM2_SE sessionType, const TPMT_SYM_DEF * symmetric, TPMI_ALG_HASH authHash, ESYS_TR * sessionHandle)

one-call function for TPM2_StartAuthSession β€” main character energy fr.

this one invokes the TPM2_StartAuthSession command in a one-call variant, which lowkey 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. πŸ’«

Parameters

  • esysContext β€” the ESYS_CONTEXT.
  • tpmKey β€” handle of a loaded decrypt key used to encrypt salt.
  • bind β€” entity providing the authValue.
  • shandle1 β€” first session handle.
  • shandle2 β€” second session handle.
  • shandle3 β€” third session handle.
  • nonceCaller β€” initial nonceCaller, sets nonceTPM size for the session.
  • sessionType β€” indicates the type of the session; simple HMAC or policy (including a trial policy).
  • symmetric β€” the algorithm and key size for parameter encryption.
  • authHash β€” hash algorithm to use for the session.
  • sessionHandle β€” ESYS_TR handle of ESYS resource for TPMI_SH_AUTH_SESSION.

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. not me doing two things at once πŸ™ˆ
  • 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_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_BAD_TR β€” if any of the ESYS_TR objects are unknown to the ESYS_CONTEXT or are of the wrong type or if required ESYS_TR objects are ESYS_TR_NONE.
  • TSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.

⭐ TSS2_RC Esys_StartAuthSession_Async (ESYS_CONTEXT * esysContext, ESYS_TR tpmKey, ESYS_TR bind, ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3, const TPM2B_NONCE * nonceCaller, TPM2_SE sessionType, const TPMT_SYM_DEF * symmetric, TPMI_ALG_HASH authHash)

asynchronous function for TPM2_StartAuthSession β€” the "send it and dip" option πŸƒβ€β™€οΈπŸ’¨

this one invokes the TPM2_StartAuthSession command in an asynchronous variant, so 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_StartAuthSession_Finish. iykyk ✨

Parameters

  • esysContext β€” the ESYS_CONTEXT.
  • tpmKey β€” handle of a loaded decrypt key used to encrypt salt.
  • bind β€” entity providing the authValue.
  • shandle1 β€” first session handle.
  • shandle2 β€” second session handle.
  • shandle3 β€” third session handle.
  • nonceCaller β€” initial nonceCaller, sets nonceTPM size for the session.
  • sessionType β€” indicates the type of the session; simple HMAC or policy (including a trial policy).
  • symmetric β€” the algorithm and key size for parameter encryption.
  • authHash β€” hash algorithm to use for the session.

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_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_BAD_TR β€” if any of the ESYS_TR objects are unknown to the ESYS_CONTEXT or are of the wrong type or if required ESYS_TR objects are ESYS_TR_NONE.

⭐ TSS2_RC Esys_StartAuthSession_Finish (ESYS_CONTEXT * esysContext, ESYS_TR * sessionHandle)

asynchronous finish function for TPM2_StartAuthSession β€” the "okay so what did the TPM say" moment 🫢

this function returns the results of a TPM2_StartAuthSession command invoked via Esys_StartAuthSession_Finish. all non-simple output parameters are allocated by the function's implementation. and listen β€” NULL can be passed for every output parameter if the value is not required. convenient much? πŸ’…

heads up bestie: yes, the doc literally says the command was invoked via Esys_StartAuthSession_Finish. that's just what's written here, we're not gonna fight it 😭

Parameters

  • esysContext β€” the ESYS_CONTEXT.
  • sessionHandle β€” ESYS_TR handle of ESYS resource for TPMI_SH_AUTH_SESSION.

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.

πŸ‘‘ Author πŸ‘‘

generated automatically by Doxygen for tpm2-tss from the source code. slay, robot. πŸ€–πŸ’–


and that's the page!! this beauty comes to you from tpm2-tss, Version 4.1.5, and it's filed under Esys_StartAuthSession(3) in the Library Functions Manual. go forth and start those auth sessions, bestie β€” you're literally gonna ate this πŸŽ€βœ¨πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from