aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/gss_krb5_unseal.c
diff options
context:
space:
mode:
authorKevin Coffman <kwc@citi.umich.edu>2010-03-17 13:03:02 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-05-14 15:09:19 -0400
commit8b23707612cffdba694dcd18aa8a018918aa86dc (patch)
tree3dd484658768c0a710b252a674c697124380b223 /net/sunrpc/auth_gss/gss_krb5_unseal.c
parentbf6d359c508cf83401c942262a9749752598394d (diff)
gssd_krb5: arcfour-hmac support
For arcfour-hmac support, the make_checksum function needs a usage field to correctly calculate the checksum differently for MIC and WRAP tokens. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth_gss/gss_krb5_unseal.c')
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_unseal.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_unseal.c b/net/sunrpc/auth_gss/gss_krb5_unseal.c
index 4ede4cc4391f..ef91366e3dea 100644
--- a/net/sunrpc/auth_gss/gss_krb5_unseal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_unseal.c
@@ -115,7 +115,7 @@ gss_verify_mic_v1(struct krb5_ctx *ctx,
115 cksumkey = NULL; 115 cksumkey = NULL;
116 116
117 if (make_checksum(ctx, ptr, 8, message_buffer, 0, 117 if (make_checksum(ctx, ptr, 8, message_buffer, 0,
118 cksumkey, &md5cksum)) 118 cksumkey, KG_USAGE_SIGN, &md5cksum))
119 return GSS_S_FAILURE; 119 return GSS_S_FAILURE;
120 120
121 if (memcmp(md5cksum.data, ptr + GSS_KRB5_TOK_HDR_LEN, 121 if (memcmp(md5cksum.data, ptr + GSS_KRB5_TOK_HDR_LEN,
@@ -154,6 +154,7 @@ gss_verify_mic_v2(struct krb5_ctx *ctx,
154 u8 *cksumkey; 154 u8 *cksumkey;
155 u8 flags; 155 u8 flags;
156 int i; 156 int i;
157 unsigned int cksum_usage;
157 158
158 dprintk("RPC: %s\n", __func__); 159 dprintk("RPC: %s\n", __func__);
159 160
@@ -174,13 +175,16 @@ gss_verify_mic_v2(struct krb5_ctx *ctx,
174 if (ptr[i] != 0xff) 175 if (ptr[i] != 0xff)
175 return GSS_S_DEFECTIVE_TOKEN; 176 return GSS_S_DEFECTIVE_TOKEN;
176 177
177 if (ctx->initiate) 178 if (ctx->initiate) {
178 cksumkey = ctx->acceptor_sign; 179 cksumkey = ctx->acceptor_sign;
179 else 180 cksum_usage = KG_USAGE_ACCEPTOR_SIGN;
181 } else {
180 cksumkey = ctx->initiator_sign; 182 cksumkey = ctx->initiator_sign;
183 cksum_usage = KG_USAGE_INITIATOR_SIGN;
184 }
181 185
182 if (make_checksum_v2(ctx, ptr, GSS_KRB5_TOK_HDR_LEN, message_buffer, 0, 186 if (make_checksum_v2(ctx, ptr, GSS_KRB5_TOK_HDR_LEN, message_buffer, 0,
183 cksumkey, &cksumobj)) 187 cksumkey, cksum_usage, &cksumobj))
184 return GSS_S_FAILURE; 188 return GSS_S_FAILURE;
185 189
186 if (memcmp(cksumobj.data, ptr + GSS_KRB5_TOK_HDR_LEN, 190 if (memcmp(cksumobj.data, ptr + GSS_KRB5_TOK_HDR_LEN,