diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-10-26 00:37:12 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-26 00:37:12 -0700 |
commit | a6767721a563acb172c73f693fcf719b3b3d6716 (patch) | |
tree | dbf8490f91cb4f85c9683e425dbf36dd8b1b5719 | |
parent | 564262c1f0b0f0ce852ecd7f60672f79985595ee (diff) | |
download | linux-3.10-a6767721a563acb172c73f693fcf719b3b3d6716.tar.gz linux-3.10-a6767721a563acb172c73f693fcf719b3b3d6716.tar.bz2 linux-3.10-a6767721a563acb172c73f693fcf719b3b3d6716.zip |
[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>
-rw-r--r-- | crypto/hmac.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/hmac.c b/crypto/hmac.c index e3f5c0f3e2f..0f05be769c3 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c @@ -61,7 +61,7 @@ static int hmac_setkey(struct crypto_hash *parent, desc.tfm = tfm; desc.flags = crypto_hash_get_flags(parent); desc.flags &= CRYPTO_TFM_REQ_MAY_SLEEP; - sg_set_buf(&tmp, inkey, keylen); + sg_init_one(&tmp, inkey, keylen); err = crypto_hash_digest(&desc, &tmp, keylen, digest); if (err) @@ -96,7 +96,7 @@ static int hmac_init(struct hash_desc *pdesc) desc.tfm = ctx->child; desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; - sg_set_buf(&tmp, ipad, bs); + sg_init_one(&tmp, ipad, bs); err = crypto_hash_init(&desc); if (unlikely(err)) @@ -131,7 +131,7 @@ static int hmac_final(struct hash_desc *pdesc, u8 *out) desc.tfm = ctx->child; desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; - sg_set_buf(&tmp, opad, bs + ds); + sg_init_one(&tmp, opad, bs + ds); err = crypto_hash_final(&desc, digest); if (unlikely(err)) |