diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-09 08:04:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-09 08:04:14 +0000 |
commit | 90e4bb6ac55713bbad28f98f515b9d5dcafb7c82 (patch) | |
tree | 8d020c088a40dc6f1db2a16e6697db7a22238da0 /src/nvme/linux.h | |
parent | Releasing debian version 1.10-1. (diff) | |
download | libnvme-90e4bb6ac55713bbad28f98f515b9d5dcafb7c82.tar.xz libnvme-90e4bb6ac55713bbad28f98f515b9d5dcafb7c82.zip |
Merging upstream version 1.11.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/nvme/linux.h')
-rw-r--r-- | src/nvme/linux.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/nvme/linux.h b/src/nvme/linux.h index 8e5e8ad..5dbc092 100644 --- a/src/nvme/linux.h +++ b/src/nvme/linux.h @@ -437,6 +437,25 @@ long nvme_revoke_tls_key(const char *keyring, const char *key_type, char *nvme_export_tls_key(const unsigned char *key_data, int key_len); /** + * nvme_export_tls_key_versioned() - Export a TLS pre-shared key + * @version: Indicated the representation of the TLS PSK + * @hmac: HMAC algorithm used to transfor the configured PSK + * in a retained PSK + * @key_data: Raw data of the key + * @key_len: Length of @key_data + * + * Returns @key_data in the PSK Interchange format as defined in section + * 3.6.1.5 of the NVMe TCP Transport specification. + * + * Return: The string containing the TLS identity or NULL with errno set + * on error. It is the responsibility of the caller to free the returned + * string. + */ +char *nvme_export_tls_key_versioned(unsigned char version, unsigned char hmac, + const unsigned char *key_data, + size_t key_len); + +/** * nvme_import_tls_key() - Import a TLS key * @encoded_key: TLS key in PSK interchange format * @key_len: Length of the resulting key data @@ -452,6 +471,24 @@ unsigned char *nvme_import_tls_key(const char *encoded_key, int *key_len, unsigned int *hmac); /** + * nvme_import_tls_key_versioned() - Import a TLS key + * @encoded_key: TLS key in PSK interchange format + * @version: Indicated the representation of the TLS PSK + * @hmac: HMAC algorithm used to transfor the configured + * PSK in a retained PSK + * @key_len: Length of the resulting key data + * + * Imports @key_data in the PSK Interchange format as defined in section + * 3.6.1.5 of the NVMe TCP Transport specification. + * + * Return: The raw data of the PSK or NULL with errno set on error. It is + * the responsibility of the caller to free the returned string. + */ +unsigned char *nvme_import_tls_key_versioned(const char *encoded_key, + unsigned char *version, + unsigned char *hmac, + size_t *key_len); +/** * nvme_submit_passthru - Low level ioctl wrapper for passthru commands * @fd: File descriptor of the nvme device * @ioctl_cmd: IOCTL command id |