From 97cee9d13a01de4163ba2bae52fea13f15af85ed Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 10 Oct 2024 09:02:16 +0200 Subject: [PATCH] nvme: use unsigned char for hmac and identity The spec is limiting the size of both variables to one byte, thus there is no need to use wider types. Signed-off-by: Daniel Wagner --- nvme.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nvme.c b/nvme.c index 0433c2cd..5559a8b9 100644 --- a/nvme.c +++ b/nvme.c @@ -9201,8 +9201,8 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl char *hostnqn; char *subsysnqn; char *secret; - unsigned int hmac; - unsigned int identity; + unsigned char hmac; + unsigned char identity; bool insert; }; @@ -9223,8 +9223,8 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl OPT_STR("hostnqn", 'n', &cfg.hostnqn, hostnqn), OPT_STR("subsysnqn", 'c', &cfg.subsysnqn, subsysnqn), OPT_STR("secret", 's', &cfg.secret, secret), - OPT_UINT("hmac", 'm', &cfg.hmac, hmac), - OPT_UINT("identity", 'I', &cfg.identity, identity), + OPT_BYTE("hmac", 'm', &cfg.hmac, hmac), + OPT_BYTE("identity", 'I', &cfg.identity, identity), OPT_FLAG("insert", 'i', &cfg.insert, insert)); err = parse_args(argc, argv, desc, opts); @@ -9322,7 +9322,7 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct char *hostnqn; char *subsysnqn; char *keydata; - unsigned int identity; + unsigned char identity; bool insert; }; @@ -9342,7 +9342,7 @@ static int check_tls_key(int argc, char **argv, struct command *command, struct OPT_STR("hostnqn", 'n', &cfg.hostnqn, hostnqn), OPT_STR("subsysnqn", 'c', &cfg.subsysnqn, subsysnqn), OPT_STR("keydata", 'd', &cfg.keydata, keydata), - OPT_UINT("identity", 'I', &cfg.identity, identity), + OPT_BYTE("identity", 'I', &cfg.identity, identity), OPT_FLAG("insert", 'i', &cfg.insert, insert)); err = parse_args(argc, argv, desc, opts); -- 2.50.1