libnvmf_gen...key_identity(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’– libnvmf_gen...key_identity(9) πŸ’–

okay so bestie, welcome to the libnvme API manual (section 9, we're fancy here) β€” this page is all about one little function that does a whole lot of key magic, and honestly? kinda iconic. πŸŽ€


✨ NAME ✨

libnvmf_generate_tls_key_identity β€” the one that generates the TLS PSK identity πŸ¦‹


🌸 SYNOPSIS 🌸

int libnvmf_generate_tls_key_identity (struct libnvme_global_ctx *ctx ,
const char *hostnqn , const char *subsysnqn , int version , enum
libnvmf_hmac_alg hmac , unsigned char *configured_key , int key_len ,
char **identity );

like, yes, that's a lot of arguments, but we're gonna go through every single one, no cap πŸ’…


🫢 ARGUMENTS 🫢

  • ctx β€” your struct libnvme_global_ctx object, the main character of the whole libnvme situation ✨
  • hostnqn β€” the Host NVMe Qualified Name πŸ’–
  • subsysnqn β€” the Subsystem NVMe Qualified Name 🌈
  • version β€” which TLS PSK identity version you wanna use, your choice bestie ⭐
  • hmac β€” the HMAC algorithm, a whole enum libnvmf_hmac_alg moment
  • configured_key β€” the Configured PSK that we derive the retained PSK from, lowkey the important one πŸ”₯
  • key_len β€” the length of configured_key, gotta know how big it is πŸ“
  • identity β€” the TLS PSK identity we're handing back to you, the lil return gift 🎁

🧚 DESCRIPTION 🧚

so what does it actually do? it derives a retained PSK exactly as specified in the NVMe TCP Transport Specification 1.3, section 3.6.1.3 (yes, we cite our sources, we're not animals), and then it generates the corresponding TLS PSK identity. slay. πŸ‘‘

⚠️ heads up bestie: it is the responsibility of the caller to free the returned string. literally don't forget, that's YOUR job, not the function's. memory leaks are not the vibe check you want to fail 😭

πŸ’œ RETURN πŸ’œ

  • 0 on success β€” we love a clean win ✨
  • negative error code otherwise β€” sad girl hours, check your error πŸ’€


and that's the whole page, bestie! πŸ“ this lil beauty lives in the libnvme API manual, section 9, sourced from libnvmf_generate_tls_key_id, dated October 2026 β€” go forth and generate those identities, iykyk πŸ’…πŸ§šπŸ’–

πŸ“¦ where this page comes from