Reference

libnvmf_insert_tls_key-libnvme3(2)

Derive and insert a TLS PSK

NAME

libnvmf_insert_tls_key - Derive and insert a TLS PSK

SYNOPSIS

int libnvmf_insert_tls_key (struct libnvme_global_ctx *ctx , const char *keyring , const char *key_type , const char *hostnqn , const char *subsysnqn , enum libnvmf_hmac_alg hmac , unsigned char *configured_key , int key_len , long *key );

ARGUMENTS

ctx

struct libnvme_global_ctx object

keyring

Keyring to use

key_type

Type of the resulting key

hostnqn

Host NVMe Qualified Name

subsysnqn

Subsystem NVMe Qualified Name

hmac

HMAC algorithm

configured_key

Configured PSK to derive the retained PSK from

key_len

Length of configured_key

key

Key serial to return

DESCRIPTION

Derives a retained PSK from configured_key and, from that, the TLS PSK and its identity, using identity version 0, as specified in the NVMe TCP Transport Specification 1.0, section 3.6.1.3. Stores the TLS PSK as type key_type under that identity in the keyring specified by keyring.

The NVMe TCP Transport Specification 1.3 marks identity version 0 obsolete. Use libnvmf_insert_tls_key_versioned to select the identity version.

RETURN

0 on success, negative error code otherwise.