tpm2_buf_append_auth(9)
π tpm2_buf_append_auth(9) β from the Kernel API Manual, bestie
okay so picture this: you're deep in kernel land, and you need to slap a TPMS_AUTH_COMMAND onto the end of a buffer. that's it, that's the whole job. this is the function for it. you're gonna be so good at this, i can feel it π«Ά
β¨ NAME β¨
tpm2_buf_append_auth β append TPMS_AUTH_COMMAND to the buffer. literally that. iconic behaviour, no notes π
πΈ SYNOPSIS πΈ
void tpm2_buf_append_auth (struct tpm_buf *buf , u32 session_handle ,
const u8 *nonce , u16 nonce_len , u8 attributes , const u8 *hmac , u16
hmac_len );
seven arguments, one function, zero vibes wasted. let's meet them all one by one, mwah π
π¦ ARGUMENTS π¦
bufβ an allocatedtpm_bufinstance. yes, already allocated. like, do that part first, bestie, this function is not your parent πsession_handleβ the session handle. it's au32, it's right there in the name, we love a self-describing king πnonceβ the session nonce. may beNULLif not used β so like, if there's no nonce, you can just passNULLand it's fine, no drama πnonce_lenβ the session nonce length. may be0if not used. matching set with the nonce above, they're giving coordinated outfit energy β¨attributesβ the session attributes. au8of pure attitude. it's giving main character energy nglhmacβ the session HMAC or password. may beNULLif not used. so if you've got nothing to put there,NULLis lowkey acceptable, we're not judging πhmac_lenβ the session HMAC or password length, maybe0if not used. yeah it says maybe, and honestly? same, bestie, same π
fr fr tho: theNULL/0situations are only "if not used" β those args are optional only in that case, not just whenever you feel like skipping them. read the room π
π SEE ALSO π
go poke around in the kernel file, it's right here:
./security/keys/trusted-keys/trusted_tpm2.c
and these besties are basically the whole friend group, go say hi:
aaaand that's the whole page, you ate that π this little gem lives in ./security/keys/trusted-keys, it's dated October 2026, and it's filed under tpm2_buf_append_auth(9). slay, go append some auth ππβ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms