Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41fb2854 authored by Vlad Yasevich's avatar Vlad Yasevich Committed by David S. Miller
Browse files

[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: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8a6911b1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);