Skip to content

Commit 7e091ad

Browse files
martin-gpykeithbusch
authored andcommitted
nvme-auth: update sc_c in host response
The sc_c field is currently not updated in the host response to the controller challenge leading to failures while attempting secure channel concatenation. Fix this by adding a new sc_c variable to the dhchap queue context structure which is appropriately set during negotiate and then used in the host response. Fixes: e88a759 ("nvme-tcp: request secure channel concatenation") Signed-off-by: Martin George <marting@netapp.com> Signed-off-by: Prashanth Adurthi <prashana@netapp.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent bb642e2 commit 7e091ad

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/nvme/host/auth.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ struct nvme_dhchap_queue_context {
3636
u8 status;
3737
u8 dhgroup_id;
3838
u8 hash_id;
39+
u8 sc_c;
3940
size_t hash_len;
4041
u8 c1[64];
4142
u8 c2[64];
@@ -154,6 +155,8 @@ static int nvme_auth_set_dhchap_negotiate_data(struct nvme_ctrl *ctrl,
154155
data->auth_protocol[0].dhchap.idlist[34] = NVME_AUTH_DHGROUP_6144;
155156
data->auth_protocol[0].dhchap.idlist[35] = NVME_AUTH_DHGROUP_8192;
156157

158+
chap->sc_c = data->sc_c;
159+
157160
return size;
158161
}
159162

@@ -489,7 +492,7 @@ static int nvme_auth_dhchap_setup_host_response(struct nvme_ctrl *ctrl,
489492
ret = crypto_shash_update(shash, buf, 2);
490493
if (ret)
491494
goto out;
492-
memset(buf, 0, sizeof(buf));
495+
*buf = chap->sc_c;
493496
ret = crypto_shash_update(shash, buf, 1);
494497
if (ret)
495498
goto out;
@@ -500,6 +503,7 @@ static int nvme_auth_dhchap_setup_host_response(struct nvme_ctrl *ctrl,
500503
strlen(ctrl->opts->host->nqn));
501504
if (ret)
502505
goto out;
506+
memset(buf, 0, sizeof(buf));
503507
ret = crypto_shash_update(shash, buf, 1);
504508
if (ret)
505509
goto out;

0 commit comments

Comments
 (0)