Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38391
b: refs/heads/master
c: 5b304bc
h: refs/heads/master
i:
  38389: 0062fc1
  38387: 008becb
  38383: 58a1178
v: v3
  • Loading branch information
J.Bruce Fields authored and Linus Torvalds committed Oct 4, 2006
1 parent dde75d3 commit 45ae195
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c15a486643a103eaf068e5fb3b7f9d720d579a7
refs/heads/master: 5b304bc5bfccc82b856e876e829c260df8e67ff2
30 changes: 18 additions & 12 deletions trunk/net/sunrpc/auth_gss/svcauth_gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,9 +903,9 @@ unwrap_priv_data(struct svc_rqst *rqstp, struct xdr_buf *buf, u32 seq, struct gs
struct gss_svc_data {
/* decoded gss client cred: */
struct rpc_gss_wire_cred clcred;
/* pointer to the beginning of the procedure-specific results,
* which may be encrypted/checksummed in svcauth_gss_release: */
__be32 *body_start;
/* save a pointer to the beginning of the encoded verifier,
* for use in encryption/checksumming in svcauth_gss_release: */
__be32 *verf_start;
struct rsc *rsci;
};

Expand Down Expand Up @@ -968,7 +968,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
if (!svcdata)
goto auth_err;
rqstp->rq_auth_data = svcdata;
svcdata->body_start = NULL;
svcdata->verf_start = NULL;
svcdata->rsci = NULL;
gc = &svcdata->clcred;

Expand Down Expand Up @@ -1097,6 +1097,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
goto complete;
case RPC_GSS_PROC_DATA:
*authp = rpcsec_gsserr_ctxproblem;
svcdata->verf_start = resv->iov_base + resv->iov_len;
if (gss_write_verf(rqstp, rsci->mechctx, gc->gc_seq))
goto auth_err;
rqstp->rq_cred = rsci->cred;
Expand All @@ -1110,7 +1111,6 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
gc->gc_seq, rsci->mechctx))
goto auth_err;
/* placeholders for length and seq. number: */
svcdata->body_start = resv->iov_base + resv->iov_len;
svc_putnl(resv, 0);
svc_putnl(resv, 0);
break;
Expand All @@ -1119,7 +1119,6 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
gc->gc_seq, rsci->mechctx))
goto auth_err;
/* placeholders for length and seq. number: */
svcdata->body_start = resv->iov_base + resv->iov_len;
svc_putnl(resv, 0);
svc_putnl(resv, 0);
break;
Expand Down Expand Up @@ -1150,14 +1149,21 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
u32 *
svcauth_gss_prepare_to_wrap(struct xdr_buf *resbuf, struct gss_svc_data *gsd)
{
u32 *p;
u32 *p, verf_len;

p = gsd->body_start;
gsd->body_start = NULL;
p = gsd->verf_start;
gsd->verf_start = NULL;

/* If the reply stat is nonzero, don't wrap: */
if (*(p-1) != rpc_success)
return NULL;
/* Skip the verifier: */
p += 1;
verf_len = ntohl(*p++);
p += XDR_QUADLEN(verf_len);
/* move accept_stat to right place: */
memcpy(p, p + 2, 4);
/* Don't wrap in failure case: */
/* Counting on not getting here if call was not even accepted! */
/* Also don't wrap if the accept stat is nonzero: */
if (*p != rpc_success) {
resbuf->head[0].iov_len -= 2 * 4;
return NULL;
Expand Down Expand Up @@ -1283,7 +1289,7 @@ svcauth_gss_release(struct svc_rqst *rqstp)
if (gc->gc_proc != RPC_GSS_PROC_DATA)
goto out;
/* Release can be called twice, but we only wrap once. */
if (gsd->body_start == NULL)
if (gsd->verf_start == NULL)
goto out;
/* normally not set till svc_send, but we need it here: */
/* XXX: what for? Do we mess it up the moment we call svc_putu32
Expand Down

0 comments on commit 45ae195

Please sign in to comment.