diff options
| author | Trond Myklebust <trond.myklebust@fys.uio.no> | 2004-02-07 16:35:27 +0100 |
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@fys.uio.no> | 2004-02-07 16:35:27 +0100 |
| commit | 0ca8cb3651edc5932c5ff9ba3f72869bbc8a7ff5 (patch) | |
| tree | 3753e8e5f36f12ccbc88392ae168e0078190eb62 | |
| parent | 3f13d9aac2492d1f1c543453785f25bff0255aab (diff) | |
RPCSEC_GSS: Instead of having gss_get_mic allocate memory for
the mic, require the caller to pass an output buffer whose data
pointer already points to preallocated memory.
| -rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 5 | ||||
| -rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_seal.c | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 3e014068e5ae..61618c6bed5e 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c @@ -711,6 +711,7 @@ gss_marshal(struct rpc_task *task, u32 *p, int ruid) /* set verifier flavor*/ *p++ = htonl(RPC_AUTH_GSS); + bufout.data = (u8 *)(p + 1); maj_stat = gss_get_mic(ctx->gc_gss_ctx, GSS_C_QOP_DEFAULT, &bufin, &bufout); @@ -719,9 +720,9 @@ gss_marshal(struct rpc_task *task, u32 *p, int ruid) maj_stat); goto out_put_ctx; } - p = xdr_encode_netobj(p, &bufout); + *p++ = htonl(bufout.len); + p += XDR_QUADLEN(bufout.len); gss_put_ctx(ctx); - kfree(bufout.data); return p; out_put_ctx: gss_put_ctx(ctx); diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c index e664d3ea98ce..eaf19d7c8e25 100644 --- a/net/sunrpc/auth_gss/gss_krb5_seal.c +++ b/net/sunrpc/auth_gss/gss_krb5_seal.c @@ -93,8 +93,6 @@ krb5_make_token(struct krb5_ctx *ctx, int qop_req, now = jiffies; - token->data = NULL; - if (qop_req != 0) goto out_err; @@ -122,8 +120,6 @@ krb5_make_token(struct krb5_ctx *ctx, int qop_req, } token->len = g_token_size(&ctx->mech_used, 22 + tmsglen); - if ((token->data = kmalloc(token->len, GFP_KERNEL)) == NULL) - goto out_err; ptr = token->data; g_make_token_header(&ctx->mech_used, 22 + tmsglen, &ptr, toktype); |
