Skip to content

Commit 551285c

Browse files
committed
nvme/{043,045}: use SHA-512 DH-HMAC-CHAP keys
We really should not use keys with a length smaller than the hash length, so use SHA-512 keys to ensure we always have a large enough key. Signed-off-by: Hannes Reinecke <[email protected]>
1 parent 9aa2023 commit 551285c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/nvme/043

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test() {
3434
local hostkey
3535
local ctrldev
3636

37-
hostkey="$(nvme gen-dhchap-key -n "${def_hostnqn}" 2> /dev/null)"
37+
hostkey="$(nvme gen-dhchap-key -3 -n "${def_hostnqn}" 2> /dev/null)"
3838
if [ -z "$hostkey" ] ; then
3939
echo "nvme gen-dhchap-key failed"
4040
return 1

tests/nvme/045

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ test() {
3838
local rand_io_size
3939
local ns
4040

41-
hostkey="$(nvme gen-dhchap-key -n "${def_subsysnqn}" 2> /dev/null)"
41+
hostkey="$(nvme gen-dhchap-key -m 3 -n "${def_subsysnqn}" 2> /dev/null)"
4242
if [ -z "$hostkey" ] ; then
4343
echo "failed to generate host key"
4444
return 1
4545
fi
4646

47-
ctrlkey="$(nvme gen-dhchap-key -n "${def_subsysnqn}" 2> /dev/null)"
47+
ctrlkey="$(nvme gen-dhchap-key -m 3 -n "${def_subsysnqn}" 2> /dev/null)"
4848
if [ -z "$ctrlkey" ] ; then
4949
echo "failed to generate ctrl key"
5050
return 1
@@ -69,7 +69,7 @@ test() {
6969

7070
echo "Renew host key on the controller"
7171

72-
new_hostkey="$(nvme gen-dhchap-key --nqn "${def_subsysnqn}" 2> /dev/null)"
72+
new_hostkey="$(nvme gen-dhchap-key -m 3 -n "${def_subsysnqn}" 2> /dev/null)"
7373

7474
_set_nvmet_hostkey "${def_hostnqn}" "${new_hostkey}"
7575

@@ -79,7 +79,7 @@ test() {
7979

8080
echo "Renew ctrl key on the controller"
8181

82-
new_ctrlkey="$(nvme gen-dhchap-key --nqn "${def_subsysnqn}" 2> /dev/null)"
82+
new_ctrlkey="$(nvme gen-dhchap-key -m 3 -n "${def_subsysnqn}" 2> /dev/null)"
8383

8484
_set_nvmet_ctrlkey "${def_hostnqn}" "${new_ctrlkey}"
8585

0 commit comments

Comments
 (0)