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>
This commit is contained in:
committed by
J. Bruce Fields
parent
5743d65c2f
commit
4ab4b0bedd
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user