Skip to content

Commit 02f58e5

Browse files
Devulapally Shiva Krishnadavem330
authored andcommitted
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>
1 parent ee91ac1 commit 02f58e5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/crypto/chelsio/chcr_algo.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ static int chcr_ahash_digest(struct ahash_request *req)
20052005
req_ctx->data_len += params.bfr_len + params.sg_len;
20062006

20072007
if (req->nbytes == 0) {
2008-
create_last_hash_block(req_ctx->reqbfr, bs, 0);
2008+
create_last_hash_block(req_ctx->reqbfr, bs, req_ctx->data_len);
20092009
params.more = 1;
20102010
params.bfr_len = bs;
20112011
}

0 commit comments

Comments
 (0)