aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2007-10-25 21:46:26 -0400
committerDavid S. Miller <davem@davemloft.net>2007-10-25 21:46:26 -0400
commit41fb285430e9cb57da624d838afef7b2fc67e276 (patch)
tree5cbf870440316b9f2520b4220da3c695296f3bd9
parent8a6911b12f7a835055f3236c6cf7073f79ba0730 (diff)
[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 6691981bda11..e3f5c0f3e2f7 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -158,9 +158,11 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg,
158 desc.tfm = ctx->child; 158 desc.tfm = ctx->child;
159 desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; 159 desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
160 160
161 sg_init_table(sg1, 2);
161 sg_set_buf(sg1, ipad, bs); 162 sg_set_buf(sg1, ipad, bs);
163 sg_set_page(&sg1[1], (void *) sg, 0, 0);
162 164
163 sg_set_page(&sg[1], (void *) sg, 0, 0); 165 sg_init_table(sg2, 1);
164 sg_set_buf(sg2, opad, bs + ds); 166 sg_set_buf(sg2, opad, bs + ds);
165 167
166 err = crypto_hash_digest(&desc, sg1, nbytes + bs, digest); 168 err = crypto_hash_digest(&desc, sg1, nbytes + bs, digest);