Commit a6767721a563acb172c73f693fcf719b3b3d6716
1 parent
564262c1f0
Exists in
master
and in
7 other branches
[CRYPTO]: HMAC needs some more scatterlist fixups.
hmac_setkey(), hmac_init(), and hmac_final() have a singular on-stack scatterlist. Initialit is using sg_init_one() instead of using sg_set_buf(). Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff
crypto/hmac.c
... | ... | @@ -61,7 +61,7 @@ |
61 | 61 | desc.tfm = tfm; |
62 | 62 | desc.flags = crypto_hash_get_flags(parent); |
63 | 63 | desc.flags &= CRYPTO_TFM_REQ_MAY_SLEEP; |
64 | - sg_set_buf(&tmp, inkey, keylen); | |
64 | + sg_init_one(&tmp, inkey, keylen); | |
65 | 65 | |
66 | 66 | err = crypto_hash_digest(&desc, &tmp, keylen, digest); |
67 | 67 | if (err) |
... | ... | @@ -96,7 +96,7 @@ |
96 | 96 | |
97 | 97 | desc.tfm = ctx->child; |
98 | 98 | desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; |
99 | - sg_set_buf(&tmp, ipad, bs); | |
99 | + sg_init_one(&tmp, ipad, bs); | |
100 | 100 | |
101 | 101 | err = crypto_hash_init(&desc); |
102 | 102 | if (unlikely(err)) |
... | ... | @@ -131,7 +131,7 @@ |
131 | 131 | |
132 | 132 | desc.tfm = ctx->child; |
133 | 133 | desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; |
134 | - sg_set_buf(&tmp, opad, bs + ds); | |
134 | + sg_init_one(&tmp, opad, bs + ds); | |
135 | 135 | |
136 | 136 | err = crypto_hash_final(&desc, digest); |
137 | 137 | if (unlikely(err)) |