From fcffc2d3794b6b16ec408bef8dc35316cc3c39e2 Mon Sep 17 00:00:00 2001 From: Martin George Date: Thu, 14 Dec 2023 13:02:54 +0530 Subject: [PATCH] nvme: restric hmac options for gen-tls-key During nvme gen-tls-key generation, the permitted hmac options is 1 for SHA-256 & 2 for SHA-384 respectively for the retained key. But nvme-cli mistakenly permits an additional option 3 too which defaults to SHA-256 itself. Rectify this. Signed-off-by: Martin George --- nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvme.c b/nvme.c index 14a54117..872dc89a 100644 --- a/nvme.c +++ b/nvme.c @@ -8566,7 +8566,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl err = argconfig_parse(argc, argv, desc, opts); if (err) return err; - if (cfg.hmac < 1 || cfg.hmac > 3) { + if (cfg.hmac < 1 || cfg.hmac > 2) { nvme_show_error("Invalid HMAC identifier %u", cfg.hmac); return -EINVAL; } -- 2.50.1