TSPI_PCRCOMPOSITE_GETPCRVALUE(3)

πŸ’– Tspi_PcrComposite_GetPcrValue β€” the TCG Software Stack Developer's Reference, bestie edition πŸ’–

okay so real talk, this one is from the TCG Software Stack Developer's Reference (manual page Tspi_PcrComposite_GetPcrValue(3), if you're being formal about it) and it is genuinely one of the most useful lil functions in the whole PCR composite situation. let's get into it 🫢


✨ NAME ✨

Tspi_PcrComposite_GetPcrValue β€” get the digest value of a given PCR index inside a PCR composite object. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 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_PcrComposite_GetPcrValue(TSS_HPCRS hPcrComposite,    UINT32 ulPcrIndex,
                                         UINT32*   ulPcrValueLength, BYTE** rgbPcrValue);

look at all those headers. six of them plus tss/tspi.h for ✨sparkle✨. include them all or the compiler will simply not know who you are.


πŸ¦‹ DESCRIPTION πŸ¦‹

Tspi_PcrComposite_GetPcrValue returns the digest value of a given PCR index inside a PCR composite object.

that's the vibe. you've got a composite object, you've got an index, you want the digest that lives at that index β€” this is the function that hands it to you. no cap, it's that straightforward, and honestly? we love a girl who knows what she wants. πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

hPcrComposite

Handle of the PCR composite object instance where a PCR value should be returned. this is your entry ticket β€” it's the object you're pulling the value out of. if this handle is fake, everything downstream is fake too. πŸ’€

ulPcrIndex

This parameter indicates the index of the PCR to read. basically you're pointing at a slot and saying "that one, give me that one." 🫡

ulPcrValueLength

The length (in bytes) of the rgbPcrValue parameter. so she's not just a value, she's a value with a measurement. iconic behavior, honestly.

rgbPcrValue

After successful completion this parameter recieves a pointer to the memory block containing the PCR value of the PCR indicated by ulPcrIndex.

πŸ’‘ heads up bestie: it says "recieves" in the original and I am not about to rewrite their typo out of existence β€” that's a pointer to a memory block, so treat it with the respect a pointer to a memory block deserves. πŸ™ˆ

πŸ”₯ RETURN CODES πŸ”₯

Tspi_PcrComposite_GetPcrValue returns TSS_SUCCESS on success, otherwise one of the following values are returned:

  • TSS_E_INVALID_HANDLE β€” Either hPcrComposite or ulPcrIndex is an invalid parameter.
  • TSS_E_INTERNAL_ERROR β€” An error occurred internal to the TSS.

so: TSS_SUCCESS = slay, we ate. TSS_E_INVALID_HANDLE = bestie, check your handles, either hPcrComposite or ulPcrIndex is not it. TSS_E_INTERNAL_ERROR = the TSS itself had a moment, and it's not your fault, it's internal to the TSS. 😭


🌈 CONFORMING TO 🌈

Tspi_PcrComposite_GetPcrValue conforms to the Trusted Computing Group Software Specification version 1.1 Golden.

standard girlie behavior. she follows the spec, she doesn't freestyle. ⭐


πŸ‘‘ SEE ALSO πŸ‘‘

the whole squad, fr fr β€” go read them too, they're the get-and-set besties to this get.


and that's the whole page, bestie!! this one shipped as TSS 1.1, dated 2004-05-26 β€” yes she's an elder but she's still serving βœ¨πŸ’– stay safe out there, check your handles, and remember: the value comes after the success. periodt. πŸ’…πŸŽ€