TSPI_POLICY_SETSECRET(3)
π Tspi_Policy_SetSecret(3) β TCG Software Stack Developer's Reference, section 3 π
okay bestie, welcome to the policy secret page. this is Tspi_Policy_SetSecret from the Trusted Computing Group's Software Stack Developer's Reference, and yes it is exactly as dramatic as it sounds. sit down, grab a strawberry, we're doing auth data π
β¨ NAME β¨
Tspi_Policy_SetSecret β sets the authorization data of a policy object and defines how that data gets retrieved later. two jobs, one function, main character energy fr fr.
πΈ 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_Policy_SetSecret(TSS_HPOLICY hPolicy, TSS_FLAG secretMode,
UINT32 ulSecretLength, BYTE* rgbSecret);
like, look at those includes. seven of them. it's giving "yes i have a lot of friends" π¦
π§ DESCRIPTION π§
so TSS_Policy_SetSecret sets the authorization data for an object. that's the first thing. the second thing β and honestly the more interesting thing β is that this method also defines the handling of its retrieval. i.e. how the secret comes back out when it's needed.
and there are many different paths this can take, all decided by the secretMode flag. pick your fighter, bestie. π
π PARAMETERS π
hPolicy
the handle of the policy object. your lil policy bestie. hold it gently π«Ά
secretMode
the flag that says which policy secret mode we're setting. possible values are:
TSS_SECRET_MODE_SHA1β the secret comes in as 20 bytes of SHA-1 data. the TSP will not touch the secret. hands off. no cap πTSS_SECRET_MODE_PLAINβ the data you pass in gets hashed by the TSP using SHA-1. glow-up in progress β¨TSS_SECRET_MODE_POPUPβ the TSP will ask for a secret by displaying a GUI pop-up window. very "surprise! answer me" πTSS_SECRET_MODE_CALLBACKβ the application provides a callback function for authorization data. your app, your rules, your callback πTSS_SECRET_MODE_NONEβulSecretLenandrgbSecretare ignored, and any object requiring auth that gets assigned this policy will return an error. it's giving "i simply will not be participating" π
ulSecretLength
the length, in bytes, of the rgbSecret parameter. numbers matter, periodt.
rgbSecret
the secret data blob. the actual goods. the content. π
β RETURN CODES β
Tspi_Policy_SetSecret returns TSS_SUCCESS on success. otherwise, one of these lil guys comes back:
TSS_E_INVALID_HANDLEβhPolicyis an invalid parameter.TSS_E_INTERNAL_ERRORβ an error occurred internal to the TSS.
lowkey if you see TSS_E_INVALID_HANDLE check your handle first. that's the vibe check right there π₯
π CONFORMING TO π
Tspi_Policy_SetSecret conforms to the Trusted Computing Group Software Specification version 1.1 Golden. certified, canon, iconic π
π SEE ALSO π
and that's the whole page, bestie π this was TSS 1.1, dated 2004-05-26, from the TCG Software Stack Developer's Reference β she's been slaying since 2004 and she's not stopping. bye love u, go set some secrets responsibly πΈπ¦β¨
π¦ 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