Commit 75276847 authored by Mark O'Donovan's avatar Mark O'Donovan Committed by Keith Busch

nvme-auth: auth success1 msg always includes resp

In cases where RVALID is false, the response is still transmitted,
but is cleared to zero.

Relevant extract from the spec:
Response R2, if valid (i.e., if the RVALID field is set to 01h),
cleared to 0h otherwise
Signed-off-by: default avatarMark O'Donovan <shiftee@posteo.net>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 1147dd05
...@@ -339,10 +339,7 @@ static int nvme_auth_process_dhchap_success1(struct nvme_ctrl *ctrl, ...@@ -339,10 +339,7 @@ static int nvme_auth_process_dhchap_success1(struct nvme_ctrl *ctrl,
struct nvme_dhchap_queue_context *chap) struct nvme_dhchap_queue_context *chap)
{ {
struct nvmf_auth_dhchap_success1_data *data = chap->buf; struct nvmf_auth_dhchap_success1_data *data = chap->buf;
size_t size = sizeof(*data); size_t size = sizeof(*data) + chap->hash_len;
if (chap->s2)
size += chap->hash_len;
if (size > CHAP_BUF_SIZE) { if (size > CHAP_BUF_SIZE) {
chap->status = NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD; chap->status = NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD;
......
...@@ -1732,7 +1732,7 @@ struct nvmf_auth_dhchap_success1_data { ...@@ -1732,7 +1732,7 @@ struct nvmf_auth_dhchap_success1_data {
__u8 rsvd2; __u8 rsvd2;
__u8 rvalid; __u8 rvalid;
__u8 rsvd3[7]; __u8 rsvd3[7];
/* 'hl' bytes of response value if 'rvalid' is set */ /* 'hl' bytes of response value */
__u8 rval[]; __u8 rval[];
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment