aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sunrpc/gss_spkm3.h2
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_seal.c11
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_token.c3
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_unseal.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h
index 0beb2cf00a84..336e218c2782 100644
--- a/include/linux/sunrpc/gss_spkm3.h
+++ b/include/linux/sunrpc/gss_spkm3.h
@@ -48,7 +48,7 @@ u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struc
48#define CKSUMTYPE_RSA_MD5 0x0007 48#define CKSUMTYPE_RSA_MD5 0x0007
49 49
50s32 make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, 50s32 make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
51 struct xdr_netobj *cksum); 51 int body_offset, struct xdr_netobj *cksum);
52void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits); 52void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits);
53int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, 53int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen,
54 int explen); 54 int explen);
diff --git a/net/sunrpc/auth_gss/gss_spkm3_seal.c b/net/sunrpc/auth_gss/gss_spkm3_seal.c
index d1e12b25d6e2..86fbf7c3e39c 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_seal.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_seal.c
@@ -59,7 +59,7 @@ spkm3_make_token(struct spkm3_ctx *ctx,
59 char tokhdrbuf[25]; 59 char tokhdrbuf[25];
60 struct xdr_netobj md5cksum = {.len = 0, .data = NULL}; 60 struct xdr_netobj md5cksum = {.len = 0, .data = NULL};
61 struct xdr_netobj mic_hdr = {.len = 0, .data = tokhdrbuf}; 61 struct xdr_netobj mic_hdr = {.len = 0, .data = tokhdrbuf};
62 int tmsglen, tokenlen = 0; 62 int tokenlen = 0;
63 unsigned char *ptr; 63 unsigned char *ptr;
64 s32 now; 64 s32 now;
65 int ctxelen = 0, ctxzbit = 0; 65 int ctxelen = 0, ctxzbit = 0;
@@ -92,24 +92,23 @@ spkm3_make_token(struct spkm3_ctx *ctx,
92 } 92 }
93 93
94 if (toktype == SPKM_MIC_TOK) { 94 if (toktype == SPKM_MIC_TOK) {
95 tmsglen = 0;
96 /* Calculate checksum over the mic-header */ 95 /* Calculate checksum over the mic-header */
97 asn1_bitstring_len(&ctx->ctx_id, &ctxelen, &ctxzbit); 96 asn1_bitstring_len(&ctx->ctx_id, &ctxelen, &ctxzbit);
98 spkm3_mic_header(&mic_hdr.data, &mic_hdr.len, ctx->ctx_id.data, 97 spkm3_mic_header(&mic_hdr.data, &mic_hdr.len, ctx->ctx_id.data,
99 ctxelen, ctxzbit); 98 ctxelen, ctxzbit);
100 99
101 if (make_checksum(checksum_type, mic_hdr.data, mic_hdr.len, 100 if (make_checksum(checksum_type, mic_hdr.data, mic_hdr.len,
102 text, &md5cksum)) 101 text, 0, &md5cksum))
103 goto out_err; 102 goto out_err;
104 103
105 asn1_bitstring_len(&md5cksum, &md5elen, &md5zbit); 104 asn1_bitstring_len(&md5cksum, &md5elen, &md5zbit);
106 tokenlen = 10 + ctxelen + 1 + 2 + md5elen + 1; 105 tokenlen = 10 + ctxelen + 1 + md5elen + 1;
107 106
108 /* Create token header using generic routines */ 107 /* Create token header using generic routines */
109 token->len = g_token_size(&ctx->mech_used, tokenlen + tmsglen); 108 token->len = g_token_size(&ctx->mech_used, tokenlen);
110 109
111 ptr = token->data; 110 ptr = token->data;
112 g_make_token_header(&ctx->mech_used, tokenlen + tmsglen, &ptr); 111 g_make_token_header(&ctx->mech_used, tokenlen, &ptr);
113 112
114 spkm3_make_mic_token(&ptr, tokenlen, &mic_hdr, &md5cksum, md5elen, md5zbit); 113 spkm3_make_mic_token(&ptr, tokenlen, &mic_hdr, &md5cksum, md5elen, md5zbit);
115 } else if (toktype == SPKM_WRAP_TOK) { /* Not Supported */ 114 } else if (toktype == SPKM_WRAP_TOK) { /* Not Supported */
diff --git a/net/sunrpc/auth_gss/gss_spkm3_token.c b/net/sunrpc/auth_gss/gss_spkm3_token.c
index 1f824578d773..af0d7ce74686 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_token.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_token.c
@@ -182,6 +182,7 @@ spkm3_mic_header(unsigned char **hdrbuf, unsigned int *hdrlen, unsigned char *ct
182 * *tokp points to the beginning of the SPKM_MIC token described 182 * *tokp points to the beginning of the SPKM_MIC token described
183 * in rfc 2025, section 3.2.1: 183 * in rfc 2025, section 3.2.1:
184 * 184 *
185 * toklen is the inner token length
185 */ 186 */
186void 187void
187spkm3_make_mic_token(unsigned char **tokp, int toklen, struct xdr_netobj *mic_hdr, struct xdr_netobj *md5cksum, int md5elen, int md5zbit) 188spkm3_make_mic_token(unsigned char **tokp, int toklen, struct xdr_netobj *mic_hdr, struct xdr_netobj *md5cksum, int md5elen, int md5zbit)
@@ -189,7 +190,7 @@ spkm3_make_mic_token(unsigned char **tokp, int toklen, struct xdr_netobj *mic_hd
189 unsigned char *ict = *tokp; 190 unsigned char *ict = *tokp;
190 191
191 *(u8 *)ict++ = 0xa4; 192 *(u8 *)ict++ = 0xa4;
192 *(u8 *)ict++ = toklen - 2; 193 *(u8 *)ict++ = toklen;
193 memcpy(ict, mic_hdr->data, mic_hdr->len); 194 memcpy(ict, mic_hdr->data, mic_hdr->len);
194 ict += mic_hdr->len; 195 ict += mic_hdr->len;
195 196
diff --git a/net/sunrpc/auth_gss/gss_spkm3_unseal.c b/net/sunrpc/auth_gss/gss_spkm3_unseal.c
index 241d5b30dfcb..96851b0ba1ba 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_unseal.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_unseal.c
@@ -95,7 +95,7 @@ spkm3_read_token(struct spkm3_ctx *ctx,
95 ret = GSS_S_DEFECTIVE_TOKEN; 95 ret = GSS_S_DEFECTIVE_TOKEN;
96 code = make_checksum(CKSUMTYPE_RSA_MD5, ptr + 2, 96 code = make_checksum(CKSUMTYPE_RSA_MD5, ptr + 2,
97 mic_hdrlen + 2, 97 mic_hdrlen + 2,
98 message_buffer, &md5cksum); 98 message_buffer, 0, &md5cksum);
99 99
100 if (code) 100 if (code)
101 goto out; 101 goto out;