aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@fieldses.org>2006-12-04 20:22:37 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-06 10:46:45 -0500
commit2818bf81a8c91fb29634df68bdc3cc5e003201d0 (patch)
tree8835e6bc382b43bb4546f3063573d46936ba711c
parent5eb064f93973def1ec2ab4a46929e94389a6283b (diff)
rpcgss: krb5: kill checksum_type, miscellaneous small cleanup
Previous changes reveal some obvious cruft. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_seal.c4
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_unseal.c8
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_wrap.c12
3 files changed, 4 insertions, 20 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c
index a496af585a08..2bc22776be55 100644
--- a/net/sunrpc/auth_gss/gss_krb5_seal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_seal.c
@@ -77,7 +77,6 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
77 struct xdr_netobj *token) 77 struct xdr_netobj *token)
78{ 78{
79 struct krb5_ctx *ctx = gss_ctx->internal_ctx_id; 79 struct krb5_ctx *ctx = gss_ctx->internal_ctx_id;
80 s32 checksum_type;
81 char cksumdata[16]; 80 char cksumdata[16];
82 struct xdr_netobj md5cksum = {.len = 0, .data = cksumdata}; 81 struct xdr_netobj md5cksum = {.len = 0, .data = cksumdata};
83 unsigned char *ptr, *krb5_hdr, *msg_start; 82 unsigned char *ptr, *krb5_hdr, *msg_start;
@@ -88,7 +87,6 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
88 87
89 now = get_seconds(); 88 now = get_seconds();
90 89
91 checksum_type = CKSUMTYPE_RSA_MD5;
92 if (ctx->sealalg != SEAL_ALG_NONE && ctx->sealalg != SEAL_ALG_DES) { 90 if (ctx->sealalg != SEAL_ALG_NONE && ctx->sealalg != SEAL_ALG_DES) {
93 dprintk("RPC: gss_krb5_seal: ctx->sealalg %d not supported\n", 91 dprintk("RPC: gss_krb5_seal: ctx->sealalg %d not supported\n",
94 ctx->sealalg); 92 ctx->sealalg);
@@ -110,7 +108,7 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
110 *(__be16 *)(krb5_hdr + 2) = htons(SGN_ALG_DES_MAC_MD5); 108 *(__be16 *)(krb5_hdr + 2) = htons(SGN_ALG_DES_MAC_MD5);
111 memset(krb5_hdr + 4, 0xff, 4); 109 memset(krb5_hdr + 4, 0xff, 4);
112 110
113 if (make_checksum(checksum_type, krb5_hdr, 8, text, 0, &md5cksum)) 111 if (make_checksum(CKSUMTYPE_RSA_MD5, krb5_hdr, 8, text, 0, &md5cksum))
114 goto out_err; 112 goto out_err;
115 113
116 if (krb5_encrypt(ctx->seq, NULL, md5cksum.data, 114 if (krb5_encrypt(ctx->seq, NULL, md5cksum.data,
diff --git a/net/sunrpc/auth_gss/gss_krb5_unseal.c b/net/sunrpc/auth_gss/gss_krb5_unseal.c
index 23b509dedf97..60469d9ab226 100644
--- a/net/sunrpc/auth_gss/gss_krb5_unseal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_unseal.c
@@ -78,7 +78,6 @@ gss_verify_mic_kerberos(struct gss_ctx *gss_ctx,
78 struct krb5_ctx *ctx = gss_ctx->internal_ctx_id; 78 struct krb5_ctx *ctx = gss_ctx->internal_ctx_id;
79 int signalg; 79 int signalg;
80 int sealalg; 80 int sealalg;
81 s32 checksum_type;
82 char cksumdata[16]; 81 char cksumdata[16];
83 struct xdr_netobj md5cksum = {.len = 0, .data = cksumdata}; 82 struct xdr_netobj md5cksum = {.len = 0, .data = cksumdata};
84 s32 now; 83 s32 now;
@@ -115,12 +114,7 @@ gss_verify_mic_kerberos(struct gss_ctx *gss_ctx,
115 if (signalg != SGN_ALG_DES_MAC_MD5) 114 if (signalg != SGN_ALG_DES_MAC_MD5)
116 goto out; 115 goto out;
117 116
118 /* compute the checksum of the message */ 117 ret = make_checksum(CKSUMTYPE_RSA_MD5, ptr - 2, 8,
119
120 /* initialize the the cksum */
121 checksum_type = CKSUMTYPE_RSA_MD5;
122
123 ret = make_checksum(checksum_type, ptr - 2, 8,
124 message_buffer, 0, &md5cksum); 118 message_buffer, 0, &md5cksum);
125 if (ret) 119 if (ret)
126 goto out; 120 goto out;
diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c
index a7d5c135139b..206937187274 100644
--- a/net/sunrpc/auth_gss/gss_krb5_wrap.c
+++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c
@@ -120,7 +120,6 @@ gss_wrap_kerberos(struct gss_ctx *ctx, int offset,
120 struct xdr_buf *buf, struct page **pages) 120 struct xdr_buf *buf, struct page **pages)
121{ 121{
122 struct krb5_ctx *kctx = ctx->internal_ctx_id; 122 struct krb5_ctx *kctx = ctx->internal_ctx_id;
123 s32 checksum_type;
124 char cksumdata[16]; 123 char cksumdata[16];
125 struct xdr_netobj md5cksum = {.len = 0, .data = cksumdata}; 124 struct xdr_netobj md5cksum = {.len = 0, .data = cksumdata};
126 int blocksize = 0, plainlen; 125 int blocksize = 0, plainlen;
@@ -134,7 +133,6 @@ gss_wrap_kerberos(struct gss_ctx *ctx, int offset,
134 133
135 now = get_seconds(); 134 now = get_seconds();
136 135
137 checksum_type = CKSUMTYPE_RSA_MD5;
138 if (kctx->sealalg != SEAL_ALG_NONE && kctx->sealalg != SEAL_ALG_DES) { 136 if (kctx->sealalg != SEAL_ALG_NONE && kctx->sealalg != SEAL_ALG_DES) {
139 dprintk("RPC: gss_krb5_seal: kctx->sealalg %d not supported\n", 137 dprintk("RPC: gss_krb5_seal: kctx->sealalg %d not supported\n",
140 kctx->sealalg); 138 kctx->sealalg);
@@ -178,7 +176,7 @@ gss_wrap_kerberos(struct gss_ctx *ctx, int offset,
178 /* XXXJBF: UGH!: */ 176 /* XXXJBF: UGH!: */
179 tmp_pages = buf->pages; 177 tmp_pages = buf->pages;
180 buf->pages = pages; 178 buf->pages = pages;
181 if (make_checksum(checksum_type, krb5_hdr, 8, buf, 179 if (make_checksum(CKSUMTYPE_RSA_MD5, krb5_hdr, 8, buf,
182 offset + headlen - blocksize, &md5cksum)) 180 offset + headlen - blocksize, &md5cksum))
183 goto out_err; 181 goto out_err;
184 buf->pages = tmp_pages; 182 buf->pages = tmp_pages;
@@ -215,7 +213,6 @@ gss_unwrap_kerberos(struct gss_ctx *ctx, int offset, struct xdr_buf *buf)
215 struct krb5_ctx *kctx = ctx->internal_ctx_id; 213 struct krb5_ctx *kctx = ctx->internal_ctx_id;
216 int signalg; 214 int signalg;
217 int sealalg; 215 int sealalg;
218 s32 checksum_type;
219 char cksumdata[16]; 216 char cksumdata[16];
220 struct xdr_netobj md5cksum = {.len = 0, .data = cksumdata}; 217 struct xdr_netobj md5cksum = {.len = 0, .data = cksumdata};
221 s32 now; 218 s32 now;
@@ -275,12 +272,7 @@ gss_unwrap_kerberos(struct gss_ctx *ctx, int offset, struct xdr_buf *buf)
275 ptr + 22 - (unsigned char *)buf->head[0].iov_base)) 272 ptr + 22 - (unsigned char *)buf->head[0].iov_base))
276 goto out; 273 goto out;
277 274
278 /* compute the checksum of the message */ 275 ret = make_checksum(CKSUMTYPE_RSA_MD5, ptr - 2, 8, buf,
279
280 /* initialize the the cksum */
281 checksum_type = CKSUMTYPE_RSA_MD5;
282
283 ret = make_checksum(checksum_type, ptr - 2, 8, buf,
284 ptr + 22 - (unsigned char *)buf->head[0].iov_base, &md5cksum); 276 ptr + 22 - (unsigned char *)buf->head[0].iov_base, &md5cksum);
285 if (ret) 277 if (ret)
286 goto out; 278 goto out;