From f32824d8ca9d3f84613ae2422070cc5469fe9e91 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields - unquoted" Date: Sat, 10 Feb 2007 01:33:25 -0500 Subject: spkm3: fix spkm3's use of hmac I think I botched an attempt to keep an spkm3 patch up-to-date with a recent crypto api change. Signed-off-by: J. Bruce Fields Signed-off-by: Trond Myklebust --- net/sunrpc/auth_gss/gss_spkm3_seal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/sunrpc/auth_gss/gss_spkm3_seal.c') diff --git a/net/sunrpc/auth_gss/gss_spkm3_seal.c b/net/sunrpc/auth_gss/gss_spkm3_seal.c index 104cbf4f769..36c3bae0c42 100644 --- a/net/sunrpc/auth_gss/gss_spkm3_seal.c +++ b/net/sunrpc/auth_gss/gss_spkm3_seal.c @@ -152,7 +152,7 @@ make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header, switch (cksumtype) { case CKSUMTYPE_HMAC_MD5: - cksumname = "md5"; + cksumname = "hmac(md5)"; break; default: dprintk("RPC: spkm3_make_checksum:" @@ -173,7 +173,7 @@ make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header, goto out; sg_set_buf(sg, header, hdrlen); - crypto_hash_update(&desc, sg, 1); + crypto_hash_update(&desc, sg, sg->length); xdr_process_buf(body, body_offset, body->len - body_offset, spkm3_checksummer, &desc); -- cgit v1.2.3 From b80e183deff5f3d43565b552ed91e511128a6ea9 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields - unquoted" Date: Sat, 10 Feb 2007 01:33:26 -0500 Subject: spkm3: remove bad kfree, unnecessary export We're kfree()'ing something that was allocated on the stack! Also remove an unnecessary symbol export while we're at it. Signed-off-by: J. Bruce Fields Signed-off-by: Trond Myklebust --- net/sunrpc/auth_gss/gss_spkm3_seal.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'net/sunrpc/auth_gss/gss_spkm3_seal.c') diff --git a/net/sunrpc/auth_gss/gss_spkm3_seal.c b/net/sunrpc/auth_gss/gss_spkm3_seal.c index 36c3bae0c42..3ec9cd31420 100644 --- a/net/sunrpc/auth_gss/gss_spkm3_seal.c +++ b/net/sunrpc/auth_gss/gss_spkm3_seal.c @@ -123,9 +123,6 @@ spkm3_make_token(struct spkm3_ctx *ctx, return GSS_S_COMPLETE; out_err: - if (md5cksum.data) - kfree(md5cksum.data); - token->data = NULL; token->len = 0; return GSS_S_FAILURE; @@ -184,5 +181,3 @@ out: return err ? GSS_S_FAILURE : 0; } - -EXPORT_SYMBOL(make_spkm3_checksum); -- cgit v1.2.3 From 61322b30139b79ec77170723a3a80043dcc94e87 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields - unquoted" Date: Sat, 10 Feb 2007 01:33:27 -0500 Subject: spkm3: initialize hash There's an initialization step here I missed. Signed-off-by: J. Bruce Fields Signed-off-by: Trond Myklebust --- net/sunrpc/auth_gss/gss_spkm3_seal.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/sunrpc/auth_gss/gss_spkm3_seal.c') diff --git a/net/sunrpc/auth_gss/gss_spkm3_seal.c b/net/sunrpc/auth_gss/gss_spkm3_seal.c index 3ec9cd31420..d158635de6c 100644 --- a/net/sunrpc/auth_gss/gss_spkm3_seal.c +++ b/net/sunrpc/auth_gss/gss_spkm3_seal.c @@ -169,6 +169,10 @@ make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header, if (err) goto out; + err = crypto_hash_init(&desc); + if (err) + goto out; + sg_set_buf(sg, header, hdrlen); crypto_hash_update(&desc, sg, sg->length); -- cgit v1.2.3