Tspi_S...ibData(3)
π Tspi_SetAttribData β bestie edition β¨
okay so this is a page from the TCG Software Stack Developer's Reference, and the function we're simping for is Tspi_SetAttribData. It's the manual page Tspi_SetAttribData(3), and yes it's giving "niche TPM lore" but stick with me, it's actually so good π«Ά
πΈ NAME πΈ
Tspi_SetAttribData β set a non-32bit attribute of an object π
like, if your attribute is not a UINT32, this is the girl you call.
β¨ SYNOPSIS β¨
First you gotta include the whole squad of headers, no skipping:
#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>
and then the function itself, looking all main-character:
TSS_RESULT Tspi_SetAttribData(TSS_HOBJECT hObject, TSS_FLAG attribFlag,
TSS_FLAG subFlag, UINT32 ulAttribDataSize,
BYTE* rgbAttribData);
π¦ DESCRIPTION π¦
So Tspi_SetAttribData sets the attributes attached to a given class of object β but only the ones that aren't UINT32. If you came here with a UINT32, bestie, wrong door, this is not your function π
And here's the tea: the structure and the size of the attribute data? They depend on the attribute. So don't be out here assuming a shape, because it changes per attribute. iykyk.
π PARAMETERS π
hObject
Handle of the object where the attribute is gonna get set. This is the thing you're decorating π
attribFlag
The flag that says which attribute to set. It's the vibe check for "what are we even doing here".
subFlag
The sub flag that says which attribute to set. Yeah, there's a sub flag. It's giving "layers". π
ulAttribDataSize
Supplies the length, in bytes, of rgbAttribData. Basically: how much data are we handing over, queen? π
rgbAttribData
Pointer to the actual data that gets set for the specified attribute. The real one. The payload. The moment. β
π₯ RETURN CODES π₯
Tspi_SetAttribData returns TSS_SUCCESS when everything slays. If it doesn't? One of these beauties comes back at you:
TSS_E_INVALID_HANDLEβhObjectis an invalid parameter. πTSS_E_ATTRIB_FLAGβattribFlagis an invalid parameter.TSS_E_ATTRIB_SUBFLAGβsubFlagis an invalid parameter.TSS_E_ATTRIB_DATAβrgbAttribDatais an invalid parameter.TSS_E_BAD_PARAMETERTSS_E_INTERNAL_ERRORβ an error happened internal to the TSS. not us, it's them π«
π CONFORMING TO π
Tspi_SetAttribData conforms to the Trusted Computing Group Software Specification version 1.1 Golden. iconic behaviour, honestly.
π SEE ALSO π
Tspi_GetAttribData(3).β the other half of the duo, go read her too π§
π heads up bestie: this page literally says the structure and size of the attribute data depend on the attribute, so don't go guessing. Read the spec. no cap.
TSS 1.1 Β· 2004-05-26 β yeah she's vintage, she's been around since 2004 and she still ate. mwah π bye bestie! πβ¨
π¦ where this page comes from
- debian bookworm: libtspi-dev 0.3.15-0.3 Β· BSD-3-Clause
- debian trixie: libtspi-dev 0.3.15-0.4 Β· BSD-3-Clause
- epel 10: trousers-devel 0.3.15-11.el10_0 Β· BSD
- epel 9: trousers-devel 0.3.15-5.el9 Β· BSD
- fedora 43: trousers-devel 0.3.15-15.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-15.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-16.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-16.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: trousers-devel 0.3.15-17.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: trousers-devel 0.3.15-17.fc44 Β· LicenseRef-Callaway-BSD
- nixos 26.05: trousers 0.3.15
- nixpkgs unstable: netbsd-source 11.0
- nixpkgs unstable: trousers 0.3.15
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- ubuntu jammy: libtspi-dev 0.3.15-0.2 Β· BSD-3-Clause
- ubuntu noble: libtspi-dev 0.3.15-0.3build2 Β· BSD-3-Clause
- ubuntu questing: libtspi-dev 0.3.15-0.4
- ubuntu resolute: libtspi-dev 0.3.15-1 Β· BSD-3-Clause
- ubuntu stonking: libtspi-dev 0.3.15-1ubuntu2 Β· BSD-3-Clause
- Copyright (C) 2004 International Business Machines Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms