summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2007-10-25 18:46:26 -0700
committerDavid S. Miller <davem@davemloft.net>2007-10-25 18:46:26 -0700
commit4dc73285ba5e6da618020fd76453e744dce2d78a (patch)
tree89e3fe14a75989f28a30abd51f008f694345e059
parent499517fe79308db71930e7822a4ac1e4d5d5591e (diff)
downloadlinux-crypto-4dc73285ba5e6da618020fd76453e744dce2d78a.tar.gz
linux-crypto-4dc73285ba5e6da618020fd76453e744dce2d78a.zip
[CRYPTO]: Fix hmac_digest from the SG breakage.
Crypto now uses SG helper functions. Fix hmac_digest to use those functions correctly and fix the oops associated with it. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--crypto/hmac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/hmac.c b/crypto/hmac.c
index 6691981b..e3f5c0f3 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -158,9 +158,11 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg,
desc.tfm = ctx->child;
desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
+ sg_init_table(sg1, 2);
sg_set_buf(sg1, ipad, bs);
+ sg_set_page(&sg1[1], (void *) sg, 0, 0);
- sg_set_page(&sg[1], (void *) sg, 0, 0);
+ sg_init_table(sg2, 1);
sg_set_buf(sg2, opad, bs + ds);
err = crypto_hash_digest(&desc, sg1, nbytes + bs, digest);