TSPI_CONTEXT_GETDEFAULTPOLICY(3)

πŸ’– Tspi_Context_GetDefaultPolicy(3) πŸ’–

okay so bestie, we're in the Library Functions Manual today, and this whole page is from the TCG Software Stack Developers Reference. yes it's giving very serious cryptography girlboss energy, but don't worry, i got you 🫢


✨ NAME ✨

Tspi_Context_GetDefaultPolicy β€” get a handle to the default policy object of a given context. literally just "hey, what's the default policy around here" but for your TSS context πŸ’…


🌸 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_Context_GetDefaultPolicy(TSS_HCONTEXT hContext, TSS_HPOLICY *phPolicy);

like, you gotta include all seven of those headers first, no skipping, they're a set, they're a vibe 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

Tspi_Context_GetDefaultPolicy determines what policy is used by all of the keys in a given context. that's it, that's the whole function. it's the "so what's our default policy situation" of the context world. the policy that every key in that context is gonna be living by, you're finding out what it is πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

hContext

the hContext parameter is the handle of the context object. it's the context you're asking about, the main character in this situation πŸ’œ

phPolicy

the phPolicy parameter receives the handle of the default policy object bound to the context. so this is the output, it's where the answer lands. not you passing in a policy β€” you're getting one handed to you 🎁


πŸ”₯ RETURN CODES πŸ”₯

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

  • TSS_E_INVALID_HANDLE β€” hContext is not a valid handle. like bestie that's not a real context, what is that 😭
  • TSS_E_INTERNAL_ERROR β€” an internal SW error has been detected. not your fault, something inside went sideways πŸ’€

πŸ‘‘ CONFORMING TO πŸ‘‘

Tspi_Context_GetDefaultPolicy conforms to the Trusted Computing Group Software Specification version 1.1 Golden. periodt, it's standards-compliant and it knows it ✨


🌟 SEE ALSO 🌟

go read those too, they're the rest of the friend group, iykyk πŸ’–


real talk: this page is from TSS 1.1, dated 2004-05-25. yes, 2004. she's vintage, she's iconic, she's been serving TSS correctness for two decades and she's still here πŸ•°οΈπŸ’…

mwah, love you, go get that default policy πŸ«ΆπŸŽ€