Skip to content

Commit

Permalink
[CRYPTO]: Fix hmac_digest from the SG breakage.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Vlad Yasevich authored and davem330 committed Oct 26, 2007
1 parent 8a6911b commit 41fb285
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crypto/hmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 41fb285

Please sign in to comment.