X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=net%2Fsunrpc%2Fauth_gss%2Fgss_spkm3_token.c;h=8400b621971e2466a14e8339b9559a8241912226;hb=7baca6ad0ef09c8a78d798c93a3ce25336e8f50f;hp=854a983ccf26fd7c5fbc7c9e439bbae19ad31b70;hpb=9b4f2e9576658c4e52d95dc8d309f51b2e2db096;p=linux-2.6-omap-h63xx.git diff --git a/net/sunrpc/auth_gss/gss_spkm3_token.c b/net/sunrpc/auth_gss/gss_spkm3_token.c index 854a983ccf2..8400b621971 100644 --- a/net/sunrpc/auth_gss/gss_spkm3_token.c +++ b/net/sunrpc/auth_gss/gss_spkm3_token.c @@ -59,7 +59,7 @@ asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits) /* count trailing 0's */ for(i = in->len; i > 0; i--) { - if (*ptr == 0) { + if (*ptr == 0) { ptr--; elen--; } else @@ -82,7 +82,7 @@ asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits) /* * decode_asn1_bitstring() - * + * * decode a bitstring into a buffer of the expected length. * enclen = bit string length * explen = expected length (define in rfc) @@ -97,9 +97,9 @@ decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, int explen) return 1; } -/* +/* * SPKMInnerContextToken choice SPKM_MIC asn1 token layout - * + * * contextid is always 16 bytes plain data. max asn1 bitstring len = 17. * * tokenlen = pos[0] to end of token (max pos[45] with MD5 cksum) @@ -107,21 +107,21 @@ decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, int explen) * pos value * ---------- * [0] a4 SPKM-MIC tag - * [1] ?? innertoken length (max 44) - * - * - * tok_hdr piece of checksum data starts here + * [1] ?? innertoken length (max 44) + * * - * the maximum mic-header len = 9 + 17 = 26 + * tok_hdr piece of checksum data starts here + * + * the maximum mic-header len = 9 + 17 = 26 * mic-header * ---------- - * [2] 30 SEQUENCE tag - * [3] ?? mic-header length: (max 23) = TokenID + ContextID + * [2] 30 SEQUENCE tag + * [3] ?? mic-header length: (max 23) = TokenID + ContextID * * TokenID - all fields constant and can be hardcoded * ------- * [4] 02 Type 2 - * [5] 02 Length 2 + * [5] 02 Length 2 * [6][7] 01 01 TokenID (SPKM_MIC_TOK) * * ContextID - encoded length not constant, calculated @@ -131,17 +131,17 @@ decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, int explen) * [10] ?? ctxzbit * [11] contextid * - * mic_header piece of checksum data ends here. + * mic_header piece of checksum data ends here. * * int-cksum - encoded length not constant, calculated * --------- * [??] 03 Type 3 - * [??] ?? encoded length - * [??] ?? md5zbit + * [??] ?? encoded length + * [??] ?? md5zbit * [??] int-cksum (NID_md5 = 16) * - * maximum SPKM-MIC innercontext token length = - * 10 + encoded contextid_size(17 max) + 2 + encoded + * maximum SPKM-MIC innercontext token length = + * 10 + encoded contextid_size(17 max) + 2 + encoded * cksum_size (17 maxfor NID_md5) = 46 */ @@ -172,14 +172,14 @@ spkm3_mic_header(unsigned char **hdrbuf, unsigned int *hdrlen, unsigned char *ct *(u8 *)hptr++ = zbit; memcpy(hptr, ctxdata, elen); hptr += elen; - *hdrlen = hptr - top; + *hdrlen = hptr - top; } - -/* + +/* * spkm3_mic_innercontext_token() * - * *tokp points to the beginning of the SPKM_MIC token described - * in rfc 2025, section 3.2.1: + * *tokp points to the beginning of the SPKM_MIC token described + * in rfc 2025, section 3.2.1: * * toklen is the inner token length */ @@ -209,7 +209,7 @@ spkm3_verify_mic_token(unsigned char **tokp, int *mic_hdrlen, unsigned char **ck /* spkm3 innercontext token preamble */ if ((ptr[0] != 0xa4) || (ptr[2] != 0x30)) { - dprintk("RPC: BAD SPKM ictoken preamble\n"); + dprintk("RPC: BAD SPKM ictoken preamble\n"); goto out; } @@ -245,9 +245,9 @@ spkm3_verify_mic_token(unsigned char **tokp, int *mic_hdrlen, unsigned char **ck goto out; /* - * in the current implementation: the optional int-alg is not present - * so the default int-alg (md5) is used the optional snd-seq field is - * also not present + * in the current implementation: the optional int-alg is not present + * so the default int-alg (md5) is used the optional snd-seq field is + * also not present */ if (*mic_hdrlen != 6 + ctxelen) { @@ -255,7 +255,7 @@ spkm3_verify_mic_token(unsigned char **tokp, int *mic_hdrlen, unsigned char **ck goto out; } /* checksum */ - *cksum = (&ptr[10] + ctxelen); /* ctxelen includes ptr[10] */ + *cksum = (&ptr[10] + ctxelen); /* ctxelen includes ptr[10] */ ret = GSS_S_COMPLETE; out: