tpm2_buf_append_auth(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 allocated tpm_buf instance. yes, already allocated. like, do that part first, bestie, this function is not your parent 😭
  • session_handle β€” the session handle. it's a u32, it's right there in the name, we love a self-describing king πŸ‘‘
  • nonce β€” the session nonce. may be NULL if not used β€” so like, if there's no nonce, you can just pass NULL and it's fine, no drama πŸ’…
  • nonce_len β€” the session nonce length. may be 0 if not used. matching set with the nonce above, they're giving coordinated outfit energy ✨
  • attributes β€” the session attributes. a u8 of pure attitude. it's giving main character energy ngl
  • hmac β€” the session HMAC or password. may be NULL if not used. so if you've got nothing to put there, NULL is lowkey acceptable, we're not judging πŸ™ˆ
  • hmac_len β€” the session HMAC or password length, maybe 0 if not used. yeah it says maybe, and honestly? same, bestie, same πŸ’€
fr fr tho: the NULL / 0 situations 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