summaryrefslogtreecommitdiff
path: root/include/linux/nvme-keyring.h
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2023-08-24 16:39:12 +0200
committerKeith Busch <kbusch@kernel.org>2023-10-11 10:11:54 -0700
commit501cc6f4aca8dc0958c4d9716f0233ba7cff4830 (patch)
tree0854aad102a54c56c2b651c5f468a1cd996ef4fe /include/linux/nvme-keyring.h
parenta86062aac34d100a3117c0fff91ee1892ebfb460 (diff)
nvme-keyring: implement nvme_tls_psk_default()
Implement a function to select the preferred PSK for TLS. A 'retained' PSK should be preferred over a 'generated' PSK, and SHA-384 should be preferred to SHA-256. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'include/linux/nvme-keyring.h')
-rw-r--r--include/linux/nvme-keyring.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/nvme-keyring.h b/include/linux/nvme-keyring.h
index 32bd264a71e6..4efea9dd967c 100644
--- a/include/linux/nvme-keyring.h
+++ b/include/linux/nvme-keyring.h
@@ -8,12 +8,20 @@
#ifdef CONFIG_NVME_KEYRING
+key_serial_t nvme_tls_psk_default(struct key *keyring,
+ const char *hostnqn, const char *subnqn);
+
key_serial_t nvme_keyring_id(void);
int nvme_keyring_init(void);
void nvme_keyring_exit(void);
#else
+static inline key_serial_t nvme_tls_psk_default(struct key *keyring,
+ const char *hostnqn, const char *subnqn)
+{
+ return 0;
+}
static inline key_serial_t nvme_keyring_id(void)
{
return 0;