All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: add 'static' suffix for user-specified TLS keys
@ 2024-02-26 12:24 Hannes Reinecke
  2024-02-26 16:35 ` Daniel Wagner
  2024-03-07  9:45 ` Sagi Grimberg
  0 siblings, 2 replies; 7+ messages in thread
From: Hannes Reinecke @ 2024-02-26 12:24 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Sagi Grimberg, Keith Busch, linux-nvme, Hannes Reinecke

From: Hannes Reinecke <hare@suse.de>

If the user specifies a specific TLS key via the '--tls_key'
option to nvme-cli we should be adding a ';static' suffix
to the 'tls_key' sysfs attribute to signal that this is a
user-specific key, and not one auto-selected during TLS
protocol negotiation.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/nvme/host/sysfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
index d099218e494a..79f25029c2fb 100644
--- a/drivers/nvme/host/sysfs.c
+++ b/drivers/nvme/host/sysfs.c
@@ -674,10 +674,14 @@ static ssize_t tls_key_show(struct device *dev,
 			    struct device_attribute *attr, char *buf)
 {
 	struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
+	char *suffix = "";
 
 	if (!ctrl->tls_key)
 		return 0;
-	return sysfs_emit(buf, "%08x", key_serial(ctrl->tls_key));
+	if (ctrl->opts->tls_key)
+		suffix = ";static";
+	return sysfs_emit(buf, "%08x%s",
+			  key_serial(ctrl->tls_key), suffix);
 }
 static DEVICE_ATTR_RO(tls_key);
 #endif
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-08 12:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-26 12:24 [PATCH] nvme: add 'static' suffix for user-specified TLS keys Hannes Reinecke
2024-02-26 16:35 ` Daniel Wagner
2024-02-27  7:09   ` Hannes Reinecke
2024-03-07  9:45 ` Sagi Grimberg
2024-03-07 10:47   ` Hannes Reinecke
2024-03-08 10:42     ` Sagi Grimberg
2024-03-08 12:11       ` Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.