libnvme(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’… libnvme(9) β€” struct nvmf_auth_kxchap_challenge

okay bestie, so this is a page straight out of the libnvme API manual (yes, that libnvme, the one you keep hearing about πŸ‘‘) and it's gonna walk you through one very specific little struct. no cap, it's niche, but it's iconic niche.


πŸŽ€ NAME

struct nvmf_auth_kxchap_challenge β€” the KX-HMAC-CHAP_Challenge message, going from controller ➑️ host. that's the whole vibe: it's the challenge message, and it travels controller-to-host, periodt πŸ’Œ


✨ SYNOPSIS

here's the shape of it, and yes you're gonna want to copy this exactly because the byte layout is lowkey the entire point:

struct nvmf_auth_kxchap_challenge {
    __u8 auth_type;
    __u8 auth_id;
    __u16 rsvd2;
    __le16 t_id;
    __u8 hl;
    __u8 rsvd7;
    __u8 hashid;
    __u8 kxgid;
    __le16 kxvlen;
    __le32 seqnum;
    __u8 cval_kxv[];
};

see that last line? __u8 cval_kxv[]; β€” a flexible array member, she's giving main character energy and she's literally last 🌈


🌸 Members

  • auth_type β€” the Authentication Type, and for the deets you go look at enum nvmf_auth_protocol_id πŸ’œ
  • auth_id β€” the Authentication Identifier, spelled out over in enum nvmf_auth_kxchap_id
  • rsvd2 β€” Reserved. she's just sitting there, don't touch her πŸ™ˆ
  • t_id β€” the Transaction Identifier
  • hl β€” Hash Length, aka the length in bytes of the selected hash function. units matter, bestie, it's bytes ⭐
  • rsvd7 β€” Reserved again. another reserved lil bestie, leave her be πŸ’€
  • hashid β€” the Hash Identifier, and yep, the enum you want is enum libnvmf_hmac_alg
  • kxgid β€” the Key Exchange Group Identifier, see enum nvmf_auth_kxgid. important caveat: this gets cleared to 0h if there's no key exchange being performed 🫢
  • kxvlen β€” the KX Value Length, meaning the length in bytes of the KX Value carried in cval_kxv. and listen: it's cleared to 0h if kxgid is cleared to 0h. they move together, iykyk πŸ”₯
  • seqnum β€” the Sequence Number (S1) πŸ”’
  • cval_kxv β€” okay this is the moment. it's the Challenge Value (C1, hl bytes) followed by the KX Value (KXc, kxvlen bytes). and the KX Value is simply absent if kxvlen is cleared to 0h β€” she ghosts, respectfully ✨
fr fr, don't sleep on the 0h rules for kxgid and kxvlen β€” they're the whole reason the last field can be shorter than you'd expect πŸŽ€

and that's the page, bestie! this one dropped in October 2026 under the libnvme(9) banner β€” so go forth, lay those bytes out correctly, and slay πŸ’…πŸ¦‹πŸ“

πŸ“¦ where this page comes from