From: Martin George Date: Thu, 14 Dec 2023 07:32:54 +0000 (+0530) Subject: nvme: restric hmac options for gen-tls-key X-Git-Tag: v2.7~13 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fcffc2d3794b6b16ec408bef8dc35316cc3c39e2;p=users%2Fsagi%2Fnvme-cli.git 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 --- 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; }