TSPI_TPM_GETAUDITDIGEST(3)

✨ Tspi_TPM_GetAuditDigest ✨

okay bestie, welcome to the Tspi_T...tDigest(3) page πŸ’– this one lives in the TCG Software Stack Developer's Reference, and it's literally all about pulling up your audit digest. no cap.


🌸 NAME 🌸

Tspi_TPM_GetAuditDigest β€” retrieve the audit digest. that's it. that's the whole job. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <tss/tspi.h>

TSS_RESULT Tspi_TPM_GetAuditDigest(TSS_HTPM        hTpm,            TSS_HKEY           hKey,
                                   TSS_BOOL        closeAudit,      UINT32*            pulAuditDigestSize,
                                   BYTE**          prgbAuditDigest, TPM_COUNTER_VALUE* pCounterValue,
                                   TSS_VALIDATION* pValidationData, UINT32*            ordSize,
                                   UINT32**        ordList);

look at all those params, she's serving main character energy fr fr 😭


πŸŽ€ DESCRIPTION πŸŽ€

so like, Tspi_TPM_GetAuditDigest is the function you call to retrieve the audit digest. and here's the tea: the audit digest may be signed or unsigned β€” it's giving two very different moods.

  • if the audit digest is signed (meaning hKey is non-NULL πŸ‘‘) then you get back the current audit digest, the current audit counter and, optionally, the hash of the audited ordinal list plus a signature.
  • if the audit digest is not signed (meaning hKey is NULL πŸ™ˆ) then you get back the current audit digest, the current audit counter and the full list of audited ordinals.

either way you're eating good. ⭐


πŸ’œ PARAMETERS πŸ’œ

🌈 hTpm

handle of the TPM object. your TPM bestie. 🫢

πŸŽ€ hKey

handle of the signature key object (the handle can be NULL). yes, NULL is allowed, she's flexible like that.

πŸ’… closeAudit

a flag indicating whether or not to close the current audit digest after it is signed. ⚠️ heads up: this parameter is ignored if hKey is NULL.

✨ pulAuditDigestSize

pointer to the size of the returned audit digest. just the size, bestie, the receipts come next.

πŸ¦‹ prgbAuditDigest

pointer to a buffer that holds the returned audit digest. this is where the actual digest lives πŸ“

🌸 pCounterValue

pointer to a TPM_COUNTER_VALUE structure that holds the returned audit counter. iconic little struct.

πŸ”₯ pValidationData

pointer to a validation data structure. okay so this one is lowkey the most involved β€” the validation data structure provides external information required to compute the signature. let's break it down:

  • on input, the fields representing the ExternalData must contain an anti-replay nonce that will be used in the signing operation. 🎲
  • on output, this structure provides a buffer containing the data used to compute the validation data and a buffer containing the validation data (a signature generated by signing the data using the key referenced by hKey). πŸ”

and if this parameter is NULL then the TSS will perform the validation for you. 🫑 this parameter is ignored if hKey is NULL.

πŸ’œ ordSize

pointer to the number of ordinals in the returned audited ordinal list. ⚠️ this parameter is ignored if hKey is non-NULL.

🌟 ordList

pointer to a buffer that holds the returned audited ordinal list. ⚠️ this parameter is ignored if hKey is non-NULL.


😭 RETURN CODES 😭

Tspi_TPM_GetAuditDigest returns TSS_SUCCESS on success πŸŽ‰ otherwise one of the following values are returned:

  • TSS_E_INVALID_HANDLE
  • TSS_E_BAD_PARAMETER
  • TSS_E_INTERNAL_ERROR β€” An error occurred internal to the TSS. πŸ’€ not the internal error, we hate to see it

πŸ‘‘ CONFORMING TO πŸ‘‘

Tspi_TPM_GetAuditDigest conforms to the Trusted Computing Group Software Specification Version 1.2. certified, compliant, slay. periodt. πŸ’–


and that's the whole page bestie!! this was TSS 1.2, dated 2007-06-27 β€” yeah she's an elder icon but she still hits πŸŽ€ go get those audit digests, mwah πŸ’‹βœ¨