From: Devulapally Shiva Krishna <shiva@chelsio.com>
To: davem@davemloft.net, herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org, netdev@vger.kernel.org,
secdev@chelsio.com, Devulapally Shiva Krishna <shiva@chelsio.com>,
Ayush Sawal <ayush.sawal@chelsio.com>
Subject: [PATCH net-next 5/5] Crypto/chcr: fix for hmac(sha) test fails
Date: Tue, 5 May 2020 08:42:57 +0530 [thread overview]
Message-ID: <20200505031257.9153-6-shiva@chelsio.com> (raw)
In-Reply-To: <20200505031257.9153-1-shiva@chelsio.com>
The hmac(sha) test fails for a zero length source text data.
For hmac(sha) minimum length of the data must be of block-size.
So fix this by including the data_len for the last block.
Signed-off-by: Ayush Sawal <ayush.sawal@chelsio.com>
Signed-off-by: Devulapally Shiva Krishna <shiva@chelsio.com>
---
drivers/crypto/chelsio/chcr_algo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c
index 0d25af42cadb..b8c1c4dd3ef0 100644
--- a/drivers/crypto/chelsio/chcr_algo.c
+++ b/drivers/crypto/chelsio/chcr_algo.c
@@ -2005,7 +2005,7 @@ static int chcr_ahash_digest(struct ahash_request *req)
req_ctx->data_len += params.bfr_len + params.sg_len;
if (req->nbytes == 0) {
- create_last_hash_block(req_ctx->reqbfr, bs, 0);
+ create_last_hash_block(req_ctx->reqbfr, bs, req_ctx->data_len);
params.more = 1;
params.bfr_len = bs;
}
--
2.18.1
next prev parent reply other threads:[~2020-05-05 3:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 3:12 [PATCH net-next 0/5] Crypto/chcr: Fix issues regarding algorithm implementation in driver Devulapally Shiva Krishna
2020-05-05 3:12 ` [PATCH net-next 1/5] Crypto/chcr: fix gcm-aes and rfc4106-gcm failed tests Devulapally Shiva Krishna
2020-05-05 3:12 ` [PATCH net-next 2/5] Crypto/chcr: fix ctr, cbc, xts and rfc3686-ctr " Devulapally Shiva Krishna
2020-05-05 3:12 ` [PATCH net-next 3/5] Crypto/chcr: fix for ccm(aes) failed test Devulapally Shiva Krishna
2020-05-05 3:12 ` [PATCH net-next 4/5] Crypto/chcr: support for 48 byte key_len in aes-xts Devulapally Shiva Krishna
2020-05-05 3:12 ` Devulapally Shiva Krishna [this message]
2020-05-07 0:44 ` [PATCH net-next 0/5] Crypto/chcr: Fix issues regarding algorithm implementation in driver David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200505031257.9153-6-shiva@chelsio.com \
--to=shiva@chelsio.com \
--cc=ayush.sawal@chelsio.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=secdev@chelsio.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).