Skip to content

Commit

Permalink
Crypto/chcr: fix for hmac(sha) test fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Devulapally Shiva Krishna authored and David S. Miller committed May 7, 2020
1 parent ee91ac1 commit 02f58e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/crypto/chelsio/chcr_algo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 02f58e5

Please sign in to comment.