Skip to content

Commit

Permalink
nvme: restric hmac options for gen-tls-key
Browse files Browse the repository at this point in the history
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 <marting@netapp.com>
  • Loading branch information
martin-gpy authored and igaw committed Dec 14, 2023
1 parent 5c1b231 commit fcffc2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fcffc2d

Please sign in to comment.