diff options
author | Kevin Coffman <kwc@citi.umich.edu> | 2010-03-17 13:02:46 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:15 -0400 |
commit | 725f2865d4df31ac0768b13ae763beadc4bb8ce9 (patch) | |
tree | 20b2da47713e7f38a61d37cbb2c95ad52c88609f /net/sunrpc/auth_gss/gss_krb5_wrap.c | |
parent | 4fc4c3ce0dc1096cbd0daa3fe8f6905cbec2b87e (diff) |
gss_krb5: Introduce encryption type framework
Make the client and server code consistent regarding the extra buffer
space made available for the auth code when wrapping data.
Add some comments/documentation about the available buffer space
in the xdr_buf head and tail when gss_wrap is called.
Add a compile-time check to make sure we are not exceeding the available
buffer space.
Add a central function to shift head data.
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth_gss/gss_krb5_wrap.c')
-rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_wrap.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c index a6e905637e03..496281fabb91 100644 --- a/net/sunrpc/auth_gss/gss_krb5_wrap.c +++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c | |||
@@ -155,11 +155,9 @@ gss_wrap_kerberos(struct gss_ctx *ctx, int offset, | |||
155 | 155 | ||
156 | ptr = buf->head[0].iov_base + offset; | 156 | ptr = buf->head[0].iov_base + offset; |
157 | /* shift data to make room for header. */ | 157 | /* shift data to make room for header. */ |
158 | xdr_extend_head(buf, offset, headlen); | ||
159 | |||
158 | /* XXX Would be cleverer to encrypt while copying. */ | 160 | /* XXX Would be cleverer to encrypt while copying. */ |
159 | /* XXX bounds checking, slack, etc. */ | ||
160 | memmove(ptr + headlen, ptr, buf->head[0].iov_len - offset); | ||
161 | buf->head[0].iov_len += headlen; | ||
162 | buf->len += headlen; | ||
163 | BUG_ON((buf->len - offset - headlen) % blocksize); | 161 | BUG_ON((buf->len - offset - headlen) % blocksize); |
164 | 162 | ||
165 | g_make_token_header(&kctx->mech_used, | 163 | g_make_token_header(&kctx->mech_used, |