diff options
author | Devulapally Shiva Krishna <shiva@chelsio.com> | 2020-05-05 08:42:57 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-06 17:44:11 -0700 |
commit | 02f58e5bf2e98bf7543019d7bba21f83ff8abb13 (patch) | |
tree | cdd0625da0ba4de7253b39acba8e97dea81b013b /drivers/crypto/chelsio | |
parent | ee91ac1b11e44b38268a2f129c86a8a4ee4c218a (diff) | |
download | linux-02f58e5bf2e98bf7543019d7bba21f83ff8abb13.tar.bz2 |
Crypto/chcr: fix for hmac(sha) test fails
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/crypto/chelsio')
-rw-r--r-- | drivers/crypto/chelsio/chcr_algo.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |