aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/hmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/hmac.c')
-rw-r--r--crypto/hmac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/hmac.c b/crypto/hmac.c
index e3f5c0f3e2f7..0f05be769c34 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -61,7 +61,7 @@ static int hmac_setkey(struct crypto_hash *parent,
61 desc.tfm = tfm; 61 desc.tfm = tfm;
62 desc.flags = crypto_hash_get_flags(parent); 62 desc.flags = crypto_hash_get_flags(parent);
63 desc.flags &= CRYPTO_TFM_REQ_MAY_SLEEP; 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 err = crypto_hash_digest(&desc, &tmp, keylen, digest); 66 err = crypto_hash_digest(&desc, &tmp, keylen, digest);
67 if (err) 67 if (err)
@@ -96,7 +96,7 @@ static int hmac_init(struct hash_desc *pdesc)
96 96
97 desc.tfm = ctx->child; 97 desc.tfm = ctx->child;
98 desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; 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 err = crypto_hash_init(&desc); 101 err = crypto_hash_init(&desc);
102 if (unlikely(err)) 102 if (unlikely(err))
@@ -131,7 +131,7 @@ static int hmac_final(struct hash_desc *pdesc, u8 *out)
131 131
132 desc.tfm = ctx->child; 132 desc.tfm = ctx->child;
133 desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; 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 err = crypto_hash_final(&desc, digest); 136 err = crypto_hash_final(&desc, digest);
137 if (unlikely(err)) 137 if (unlikely(err))