aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_wrap.c2
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c10
2 files changed, 10 insertions, 2 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c
index 107c4528654f..88edec929d73 100644
--- a/net/sunrpc/auth_gss/gss_krb5_wrap.c
+++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c
@@ -574,6 +574,8 @@ gss_unwrap_kerberos_v2(struct krb5_ctx *kctx, int offset, struct xdr_buf *buf)
574 buf->head[0].iov_len -= GSS_KRB5_TOK_HDR_LEN + headskip; 574 buf->head[0].iov_len -= GSS_KRB5_TOK_HDR_LEN + headskip;
575 buf->len -= GSS_KRB5_TOK_HDR_LEN + headskip; 575 buf->len -= GSS_KRB5_TOK_HDR_LEN + headskip;
576 576
577 /* Trim off the checksum blob */
578 xdr_buf_trim(buf, GSS_KRB5_TOK_HDR_LEN + tailskip);
577 return GSS_S_COMPLETE; 579 return GSS_S_COMPLETE;
578} 580}
579 581
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 73e957386600..a5b41e2ac25a 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -817,13 +817,17 @@ read_u32_from_xdr_buf(struct xdr_buf *buf, int base, u32 *obj)
817 * The server uses base of head iovec as read pointer, while the 817 * The server uses base of head iovec as read pointer, while the
818 * client uses separate pointer. */ 818 * client uses separate pointer. */
819static int 819static int
820unwrap_integ_data(struct xdr_buf *buf, u32 seq, struct gss_ctx *ctx) 820unwrap_integ_data(struct svc_rqst *rqstp, struct xdr_buf *buf, u32 seq, struct gss_ctx *ctx)
821{ 821{
822 int stat = -EINVAL; 822 int stat = -EINVAL;
823 u32 integ_len, maj_stat; 823 u32 integ_len, maj_stat;
824 struct xdr_netobj mic; 824 struct xdr_netobj mic;
825 struct xdr_buf integ_buf; 825 struct xdr_buf integ_buf;
826 826
827 /* Did we already verify the signature on the original pass through? */
828 if (rqstp->rq_deferred)
829 return 0;
830
827 integ_len = svc_getnl(&buf->head[0]); 831 integ_len = svc_getnl(&buf->head[0]);
828 if (integ_len & 3) 832 if (integ_len & 3)
829 return stat; 833 return stat;
@@ -846,6 +850,8 @@ unwrap_integ_data(struct xdr_buf *buf, u32 seq, struct gss_ctx *ctx)
846 goto out; 850 goto out;
847 if (svc_getnl(&buf->head[0]) != seq) 851 if (svc_getnl(&buf->head[0]) != seq)
848 goto out; 852 goto out;
853 /* trim off the mic at the end before returning */
854 xdr_buf_trim(buf, mic.len + 4);
849 stat = 0; 855 stat = 0;
850out: 856out:
851 kfree(mic.data); 857 kfree(mic.data);
@@ -1190,7 +1196,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
1190 /* placeholders for length and seq. number: */ 1196 /* placeholders for length and seq. number: */
1191 svc_putnl(resv, 0); 1197 svc_putnl(resv, 0);
1192 svc_putnl(resv, 0); 1198 svc_putnl(resv, 0);
1193 if (unwrap_integ_data(&rqstp->rq_arg, 1199 if (unwrap_integ_data(rqstp, &rqstp->rq_arg,
1194 gc->gc_seq, rsci->mechctx)) 1200 gc->gc_seq, rsci->mechctx))
1195 goto garbage_args; 1201 goto garbage_args;
1196 break; 1202 break;