Fapi_NvWrite(3)

πŸ’– Fapi_NvWrite(3) β€” Library Functions Manual πŸ’–

okay bestie, you opened the Library Functions Manual page for Fapi_NvWrite, and I got you. This is the FAPI situation for writing to NV, either one-call or async. Every single detail is staying, no cap. πŸ’…

πŸŽ€ NAME πŸŽ€

Fapi_NvWrite β€” Fapi_NvWrite. That’s the whole name, iconic and to the point. 🫢

✨ SYNOPSIS ✨

🧚 Functions 🧚

TSS2_RC Fapi_NvWrite (FAPI_CONTEXT *context, char const *path, uint8_t
           const *data, size_t size)
TSS2_RC Fapi_NvWrite_Async (FAPI_CONTEXT *context, char const *path,
           uint8_t const *data, size_t size)
TSS2_RC Fapi_NvWrite_Finish (FAPI_CONTEXT *context)

🌸 Detailed Description 🌸

okay so these are the FAPI functions that invoke NvWrite either as a one-call situation or in an asynchronous manner. Pick your lane, bestie. πŸ’«

πŸ’– Function Documentation πŸ’–

🧚 TSS2_RC Fapi_NvWrite 🧚

TSS2_RC Fapi_NvWrite (FAPI_CONTEXT * context, char const * nvPath, uint8_t
       const * data, size_t size)

One-Call function for Fapi_NvWrite. Yes, capital C in β€œOne-Call,” we respect the original. It writes data to a "regular" (not pin, extend or counter) NV index. Periodt. πŸ”₯

πŸ“ Parameters πŸ“

  • context β€” The FAPI_CONTEXT
  • nvPath β€” The path of the NV index to write
  • data β€” The data to write to the NV index
  • size β€” The size of data in bytes

🩷 Return values 🩷

  • TSS2_RC_SUCCESS β€” if the function call was a success.
  • TSS2_FAPI_RC_BAD_REFERENCE β€” if context, nvPath, or data is NULL.
  • TSS2_FAPI_RC_BAD_CONTEXT β€” if context corruption is detected.
  • TSS2_FAPI_RC_BAD_PATH β€” if nvPath is not found.
  • TSS2_FAPI_RC_NV_EXCEEDED β€” if the NV is not large enough for the data to be written.
  • TSS2_FAPI_RC_NV_WRONG_TYPE β€” if the NV index is not a "regular" one.
  • TSS2_FAPI_RC_NV_NOT_WRITEABLE β€” if the NV is not a writeable index.
  • TSS2_FAPI_RC_POLICY_UNKNOWN β€” if the policy is unknown.
  • TSS2_FAPI_RC_BAD_SEQUENCE β€” if the context has an asynchronous operation already pending.
  • TSS2_FAPI_RC_IO_ERROR β€” if the data cannot be saved.
  • TSS2_FAPI_RC_MEMORY β€” if the FAPI cannot allocate enough memory for internal operations or return parameters.
  • TSS2_FAPI_RC_NO_TPM β€” if FAPI was initialized in no-TPM-mode via its config file.
  • TSS2_FAPI_RC_TRY_AGAIN β€” if an I/O operation is not finished yet and this function needs to be called again.
  • TSS2_FAPI_RC_BAD_VALUE β€” if an invalid value was passed into the function.
  • TSS2_FAPI_RC_PATH_NOT_FOUND β€” if a FAPI object path was not found during authorization.
  • TSS2_FAPI_RC_KEY_NOT_FOUND β€” if a key was not found.
  • TSS2_FAPI_RC_GENERAL_FAILURE β€” if an internal error occurred.
  • TSS2_FAPI_RC_AUTHORIZATION_UNKNOWN β€” if a required authorization callback is not set.
  • TSS2_FAPI_RC_AUTHORIZATION_FAILED β€” if the authorization attempt fails.
  • TSS2_ESYS_RC_* β€” possible error codes of ESAPI.
  • TSS2_FAPI_RC_NOT_PROVISIONED β€” FAPI was not provisioned.

🌈 TSS2_RC Fapi_NvWrite_Async 🌈

TSS2_RC Fapi_NvWrite_Async (FAPI_CONTEXT * context, char const * nvPath,
       uint8_t const * data, size_t size)

Asynchronous function for Fapi_NvWrite. It writes data to a "regular" (not pin, extend or counter) NV index. Then call Fapi_NvWrite_Finish to finish the execution of this command. Don’t leave it hanging, bestie. πŸ’«

πŸ“ Parameters πŸ“

  • context β€” The FAPI_CONTEXT
  • nvPath β€” The path of the NV index to write
  • data β€” The data to write to the NV index
  • size β€” The size of data in bytes

🩷 Return values 🩷

  • TSS2_RC_SUCCESS β€” if the function call was a success.
  • TSS2_FAPI_RC_BAD_REFERENCE β€” if context, nvPath, or data is NULL.
  • TSS2_FAPI_RC_BAD_CONTEXT β€” if context corruption is detected.
  • TSS2_FAPI_RC_BAD_PATH β€” if nvPath is not found.
  • TSS2_FAPI_RC_NV_EXCEEDED β€” if the NV is not large enough for the data to be written.
  • TSS2_FAPI_RC_NV_WRONG_TYPE β€” if the NV index is not a "regular" one.
  • TSS2_FAPI_RC_NV_NOT_WRITEABLE β€” if the NV is not a writeable index.
  • TSS2_FAPI_RC_POLICY_UNKNOWN β€” if the policy is unknown.
  • TSS2_FAPI_RC_BAD_SEQUENCE β€” if the context has an asynchronous operation already pending.
  • TSS2_FAPI_RC_IO_ERROR β€” if the data cannot be saved.
  • TSS2_FAPI_RC_MEMORY β€” if the FAPI cannot allocate enough memory for internal operations or return parameters.
  • TSS2_FAPI_RC_NO_TPM β€” if FAPI was initialized in no-TPM-mode via its config file.

πŸ¦‹ TSS2_RC Fapi_NvWrite_Finish πŸ¦‹

TSS2_RC Fapi_NvWrite_Finish (FAPI_CONTEXT * context)

Asynchronous finish function for Fapi_NvWrite. This function should be called after a previous Fapi_NvWrite. Lowkey the cleanup-era main character. ✨

πŸ“ Parameters πŸ“

  • context β€” The FAPI_CONTEXT

🩷 Return values 🩷

  • TSS2_RC_SUCCESS β€” if the function call was a success.
  • TSS2_FAPI_RC_BAD_REFERENCE β€” if context is NULL.
  • TSS2_FAPI_RC_BAD_CONTEXT β€” if context corruption is detected.
  • TSS2_FAPI_RC_BAD_SEQUENCE β€” if the context has an asynchronous operation already pending.
  • TSS2_FAPI_RC_IO_ERROR β€” if the data cannot be saved.
  • TSS2_FAPI_RC_MEMORY β€” if the FAPI cannot allocate enough memory for internal operations or return parameters.
  • TSS2_FAPI_RC_TRY_AGAIN β€” if the asynchronous operation is not yet complete. Call this function again later.
  • TSS2_FAPI_RC_BAD_VALUE β€” if an invalid value was passed into the function.
  • TSS2_FAPI_RC_BAD_PATH β€” if a path is used in inappropriate context or contains illegal characters.
  • TSS2_FAPI_RC_PATH_NOT_FOUND β€” if a FAPI object path was not found during authorization.
  • TSS2_FAPI_RC_KEY_NOT_FOUND β€” if a key was not found.
  • TSS2_FAPI_RC_GENERAL_FAILURE β€” if an internal error occurred.
  • TSS2_FAPI_RC_AUTHORIZATION_UNKNOWN β€” if a required authorization callback is not set.
  • TSS2_FAPI_RC_AUTHORIZATION_FAILED β€” if the authorization attempt fails.
  • TSS2_FAPI_RC_POLICY_UNKNOWN β€” if policy search for a certain policy digest was not successful.
  • TSS2_ESYS_RC_* β€” possible error codes of ESAPI.
  • TSS2_FAPI_RC_NOT_PROVISIONED β€” FAPI was not provisioned.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for tpm2-tss from the source code. So yeah, Doxygen wrote this, not a human with a ring light. πŸ’€


πŸ’– xoxo, bestie β€” this page comes from tpm2-tss, Version 4.1.5, and the page title is Fapi_NvWrite(3). The footer didn’t give a date, so I’m not inventing one β€” periodt. Mwah! πŸ’–

πŸ“¦ where this page comes from