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 β€” ulSecretLen and rgbSecret are 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 β€” hPolicy is 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 πŸŒΈπŸ¦‹βœ¨