nvme_auth_generate_digest(9)
π NAME π
nvme_auth_generate_digest β the little function that generates a TLS PSK digest β¨ (yes bestie, it's from the Kernel API Manual, and yes it's nvme_auth_generate_digest(9) β iykyk π«Ά)
β¨ SYNOPSIS β¨
int nvme_auth_generate_digest (u8 hmac_id , const u8 *psk , size_t
psk_len , const char *subsysnqn , const char *hostnqn , char
**ret_digest );
π ARGUMENTS π
hmac_idβ the hash function identifier π (which hash we're vibing with)pskβ the generated input PSK πpsk_lenβ length ofpsk, like, how many bytes of PSK we're working withsubsysnqnβ the NQN of the subsystem π¦hostnqnβ the NQN of the host πΈret_digestβ pointer to the returned digest, i.e. where the good stuff gets handed back to you π
π¦ DESCRIPTION π¦
Okay so the whole point of this function π₯°: it generates a TLS PSK digest, exactly as specified in TP8018 Section 3.6.1.3: TLS PSK and PSK identity Derivation. Periodt.
The PSK digest shall be computed by encoding in Base64 (refer to RFC 4648) the result of the application of the HMAC function using the hash function specified in item 4 above (ie the hash function of the cipher suite associated with the PSK identity) with the PSK as HMAC key to the concatenation of:
- the NQN of the host (i.e., NQNh) β not including the null terminator;
- a space character;
- the NQN of the NVM subsystem (i.e., NQNc) β not including the null terminator;
- a space character; and
- the seventeen ASCII characters
"NVMe-over-Fabrics"β fr fr, seventeen of them.
Like, the whole vibe is:
<PSK digest> = Base64(HMAC(PSK, NQNh || " " || NQNc || " " || "NVMe-over-Fabrics"))
The length of the PSK digest depends on the hash function used to compute it, as follows:
- if the SHA-256 hash function is used, the resulting PSK digest is 44 characters long; or
- if the SHA-384 hash function is used, the resulting PSK digest is 64 characters long. π (longer hash, longer digest, math is mathing)
Returns 0 on success with a valid digest pointer in ret_digest π β or a negative error number on failure π.
Not me emphasizing this: success =0+ valid digest pointer inret_digest; failure = negative error number. Don't get it twisted π
πΈ SEE ALSO πΈ
- Kernel file
./drivers/nvme/common/auth.cπ nvme_auth_augmented_challenge(9)nvme_auth_gen_session_key(9)nvme_auth_generate_psk(9)nvme_auth_derive_tls_psk(9)
And that's the whole page, bestie π«Ά β brought to you by the source/version ./drivers/nvme/common, dated October 2026, and filed under nvme_auth_generate_digest(9) in the Kernel API Manual. Slay, go generate some digests πβ¨ππ¦
π¦ 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