Commit d91f0323 authored by Chuck Lever's avatar Chuck Lever

SUNRPC: Replace checksum construction in svcauth_gss_wrap_integ()

Replace finicky logic: Instead of trying to find scratch space in
the response buffer, use the scratch buffer from struct
gss_svc_data.
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 15d8f808
...@@ -1797,15 +1797,8 @@ static int svcauth_gss_wrap_integ(struct svc_rqst *rqstp) ...@@ -1797,15 +1797,8 @@ static int svcauth_gss_wrap_integ(struct svc_rqst *rqstp)
*p++ = htonl(gc->gc_seq); *p++ = htonl(gc->gc_seq);
if (xdr_buf_subsegment(buf, &databody_integ, offset, len)) if (xdr_buf_subsegment(buf, &databody_integ, offset, len))
goto wrap_failed; goto wrap_failed;
if (!buf->tail[0].iov_base) {
if (buf->head[0].iov_len + RPC_MAX_AUTH_SIZE > PAGE_SIZE) checksum.data = gsd->gsd_scratch;
goto wrap_failed;
buf->tail[0].iov_base = buf->head[0].iov_base
+ buf->head[0].iov_len;
buf->tail[0].iov_len = 0;
}
resv = &buf->tail[0];
checksum.data = (u8 *)resv->iov_base + resv->iov_len + 4;
maj_stat = gss_get_mic(gsd->rsci->mechctx, &databody_integ, &checksum); maj_stat = gss_get_mic(gsd->rsci->mechctx, &databody_integ, &checksum);
if (maj_stat != GSS_S_COMPLETE) if (maj_stat != GSS_S_COMPLETE)
goto bad_mic; goto bad_mic;
......
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