Tspi_TPM_GetCapability(3)

✨ Tspi_TPM_GetCapability ✨

okay bestie, welcome to the TCG Software Stack Developer's Reference πŸ’– this one's a manual page from the Tspi_TPM_GetCapability(3) family, living in the Library Functions Manual, and it's literally your little gossip line to the TPM. let's get into it 🫢


🌸 NAME 🌸

Tspi_TPM_GetCapability β€” get information on the capabilities of the TPM πŸ‘‘


πŸŽ€ 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_GetCapability(TSS_HTPM hTPM,              TSS_FLAG capArea,
                                  UINT32   ulSubCapLength,    BYTE*    rgbSubCap,
                                  UINT32*  pulRespDataLength, BYTE**   prgbRespData);

πŸ¦‹ DESCRIPTION πŸ¦‹

so Tspi_TPM_GetCapability gets information on various capabilities of the TPM. that's it, that's the vibe ✨ you can use this command to learn how many PCRs the TPM supports, etc. it's giving "asking the TPM to spill the tea about itself" πŸ’…


πŸ’œ PARAMETERS πŸ’œ

hTPM

the hTPM parameter is used to specify the handle of the TPM object. it's the lil ID card you hand over so the TPM knows who it's talking to πŸͺͺ

capArea

the capArea parameter is the flag indicating the attribute to query. possible values are:

ulSubCapLength

the ulSubCapLength parameter is the length in bytes of the rgbSubCap parameter. yes it's just the size tag, iconic behavior πŸ“

rgbSubCap

the rgbSubCap parameter is the data indicating the attribute to query. possible values are:

pulRespDataLength

the pulRespDataLength parameter is the length in bytes of the prgbRespData parameter. it tells you how much data came back πŸŽ€

prgbRespData

the prgbRespData parameter receives a pointer to the actual data of the specified attribute. the real payload, the main character moment πŸ‘‘


⭐ NOTES ⭐

the following Capability Areas and Sub-Capability Areas are supported by 1.1 TSS's:

  • TSS_TPMCAP_ORD β€” query whether an ordinal is supported by the TPM.
    • subCaps: TPM_ORD_* (see tcpa_literals.h)
  • TSS_TPMCAP_FLAG β€” query for the volatile and non-volatile flags inside the TPM. (Must be owner authorized πŸ”). In this case, the 2 UINT32 values will be returned concatenated together in prgbRespData.
    • subCaps: ignored.
  • TSS_TPMCAP_ALG β€” query whether an algorithm is supported by the TPM.
    • subCaps:
      • TSS_ALG_RSA
      • TSS_ALG_DES
      • TSS_ALG_3DES
      • TSS_ALG_SHA
      • TSS_ALG_HMAC
      • TSS_ALG_AES
  • TSS_TPMCAP_PROPERTY β€” query a property of the TPM.
    • subCaps:
      • TSS_TPMCAP_PROP_PCR
      • TSS_TPMCAP_PROP_DIR
      • TSS_TPMCAP_PROP_MANUFACTURER
      • TSS_TPMCAP_PROP_SLOTS
  • TSS_TPMCAP_VERSION β€” get the TSS_VERSION structure tha identifies the TPM.
    • subCaps: ignored.
ngl bestie, the typo in "tha identifies the TPM" is a direct quote from the original β€” we keep it exactly as-is, no editing the ancestors πŸ“

πŸ’€ RETURN CODES πŸ’€

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

  • TSS_E_INVALID_HANDLE β€” hTPM is not a valid handle. not it 😭
  • TSS_E_INTERNAL_ERROR β€” An internal SW error has been detected. the software tripped, no cap πŸ’€
  • TSS_E_BAD_PARAMETER β€” One or more parameters is bad. bad parameters? in this economy? πŸ™ˆ

🌈 CONFORMING TO 🌈

Tspi_TPM_GetCapability conforms to the Trusted Computing Group Software Specification version 1.1 Golden β€” yes, it's certified, it's official, it ate πŸ’…


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, bestie πŸŽ€ this one's from TSS 1.1, dated 2004-05-25 β€” so yes she's an elder icon, but she still slays πŸ’–βœ¨πŸ¦‹ go query some capabilities, you got this πŸ«ΆπŸ‘‘