Tspi_TPM_PcrRead(3)

✨ Tspi_TPM_PcrRead ✨

okay bestie, gather round 🫢 this one's from the TCG Software Stack Developer's Reference, and it lives in the Library Functions Manual (section 3, obviously, iykyk). It's giving ✨PCR lore✨ and honestly? iconic.


🌸 NAME 🌸

Tspi_TPM_PcrRead β€” read the value in a PCR register πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <tss/platform.h>
#include <tss/tcpa_defines.h>
#include <tss/tcpa_typedef.h>
#include <tss/tcpa_struct.h>
#include <tss/tss_typedef.h>
#include <tss/tss_structs.h>
#include <tss/tspi.h>

TSS_RESULT Tspi_TPM_PcrRead(TSS_HTPM hTPM,              UINT32 ulPcrIndex,
                            UINT32*  pulPcrValueLength, BYTE** prgbPcrValue);

look at all those headers, not me being obsessed with a well-organized include block 😭 the way it just stacks them, periodt.


πŸ’– DESCRIPTION πŸ’–

So like, Tspi_TPM_PcrRead reads a PCR register to find the current values. That's it, that's the vibe β€” you ask the register what it's holding rn and it tells you. πŸŽ€


πŸŽ€ PARAMETERS πŸŽ€

hTPM

The hTPM parameter is used to specify the handle of the TPM object. The command to get the TPM to test itself will be sent here. 🫑

ulPcrIndex

The ulPcrIndex parameter is the index of the PCR to read. Which drawer are we opening, bestie? πŸ—„οΈ

pulPcrValueLength

The pulPcrValueLength parameter receives the length in bytes of the prgbPcrValue parameter. It's the little "how much stuff did we get" receipt 🧾✨

prgbPcrValue

The prgbPcrValue parameter receives a pointer to the memory block containing the PCR data. the actual goods πŸ’š


πŸ”₯ RETURN CODES πŸ”₯

Tspi_TPM_PcrRead returns TSS_SUCCESS on success, otherwise one of the following values is returned:

  • TSS_E_INVALID_HANDLE β€” hTPM is not a valid handle. bestie that handle is NOT it πŸ’€
  • TSS_E_INTERNAL_ERROR β€” An internal SW error has been detected. uh oh πŸ™ˆ something deep down went sideways
  • TSS_E_BAD_PARAMETER β€” One or more parameters is bad. naughty parameters, jail 🚨

πŸ‘‘ CONFORMING TO πŸ‘‘

Tspi_TPM_PcrRead conforms to the Trusted Computing Group Software Specification version 1.1 Golden. standards queen behavior ✨


🌈 SEE ALSO 🌈


aaaand that's the whole page, no skips, no crumbs left behind πŸ’– This was TSS 1.1, dated 2004-05-25, and honestly it ate. slay, bye bestie! πŸ’…βœ¨