aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/gss_spkm3_seal.c
diff options
context:
space:
mode:
authorKevin Coffman <kwc@citi.umich.edu>2008-03-31 10:31:44 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-04-23 16:13:41 -0400
commit4ab4b0bedda7d41c63cef98cd5d6cabada460936 (patch)
treeb86a8e45d260fa29a0fbf647c10b1f99ab14e18f /net/sunrpc/auth_gss/gss_spkm3_seal.c
parentgss_krb5: consistently use unsigned for seqnum (diff)
downloadlinux-dev-4ab4b0bedda7d41c63cef98cd5d6cabada460936.tar.xz
linux-dev-4ab4b0bedda7d41c63cef98cd5d6cabada460936.zip
sunrpc: make token header values less confusing
g_make_token_header() and g_token_size() add two too many, and therefore their callers pass in "(logical_value - 2)" rather than "logical_value" as hard-coded values which causes confusion. This dates back to the original g_make_token_header which took an optional token type (token_id) value and added it to the token. This was removed, but the routine always adds room for the token_id rather than not. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net/sunrpc/auth_gss/gss_spkm3_seal.c')
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_seal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sunrpc/auth_gss/gss_spkm3_seal.c b/net/sunrpc/auth_gss/gss_spkm3_seal.c
index abf17ce2e3b1..c832712f8d55 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_seal.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_seal.c
@@ -107,10 +107,10 @@ spkm3_make_token(struct spkm3_ctx *ctx,
tokenlen = 10 + ctxelen + 1 + md5elen + 1;
/* Create token header using generic routines */
- token->len = g_token_size(&ctx->mech_used, tokenlen);
+ token->len = g_token_size(&ctx->mech_used, tokenlen + 2);
ptr = token->data;
- g_make_token_header(&ctx->mech_used, tokenlen, &ptr);
+ g_make_token_header(&ctx->mech_used, tokenlen + 2, &ptr);
spkm3_make_mic_token(&ptr, tokenlen, &mic_hdr, &md5cksum, md5elen, md5zbit);
} else if (toktype == SPKM_WRAP_TOK) { /* Not Supported */