TPMLIB_DecodeBlob(3)

πŸ’… TPMLIB_DecodeBlob(3) β€” the libtpms glow-up

okay so bestie, welcome to TPMLIB_DecodeBlob, a page from the libtpms manual, and honestly? she's a little decoder with main character energy. let's get into it ✨


πŸŽ€ NAME

TPMLIB_DecodeBlob β€” decode a base64-encoded TPM blob. that's it, that's the whole vibe 🫢


🌸 SYNOPSIS

#include <libtpms/tpm_types.h>

#include <libtpms/tpm_library.h>

TPM_RESULT TPMLIB_DecodeBlob(const char *buffer,
                             enum TPMLIB_BlobType type,
                             unsigned char **result
                             size_t *result_len);

copy that exactly, bestie, no cap β€” i said what i said πŸ’…


πŸ¦‹ DESCRIPTION

so the TPMLIB_DecodeBlob() function is literally here to decode a base64-encoded TPM state blob. the caller has to pass in what type of blob is expected to be decoded, and after that the function goes hunting for the start and end markers of the data πŸ”βœ¨

here's the types of blobs that are supported, plus their start and end markers β€” iconic list incoming:

πŸ’œ BLOB_TYPE_INITSTATE

  • '-----BEGIN INITSTATE-----' marks the beginning of the base64-encoded blob. 🎬
  • '-----END INITSTATE-----' marks the end of the base64-encoded blob. 🏁

this function is highkey useful when you're passing state to the TPM inside the callback that gets invoked to grab the TPM's state blob. see TPMLIB_RegisterCallbacks(3). iykyk πŸ’–


πŸ”₯ ERRORS

  • TPM_SUCCESS β€” the function completed successfully. slay, we love a happy ending πŸ‘‘
  • TPM_SIZE β€” the size of a requested buffer exceeds the limit, or the system is out of memory 😭 (genuinely not the moment)
  • TPM_FAIL β€” an error happened while attempting to decode the blob πŸ’€ it's giving "something went wrong"

for the complete list of TPM error codes, please consult the include file libtpms/tpm_error.h β€” she has the receipts πŸ“œ


🌈 SEE ALSO

TPMLIB_MainInit(3), TPMLIB_RegisterCallbacks(3) β€” go read those too, bestie, they're part of the lore 🧚


reminder: those markers and flags are literal β€” copy them character for character. no improvising, no "fixing" the vibes into different text πŸ™ˆ

⭐ okay that's the page!! brought to you by libtpms, dated 2026-01-02, and it's the TPMLIB_DecodeBlob(3) manual β€” drink some water, decode your blobs responsibly, and stan a well-documented library πŸ’…πŸ’–πŸŽ€

πŸ“¦ where this page comes from