提交 02f58e5b 编写于 作者: D Devulapally Shiva Krishna 提交者: David S. Miller

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: NAyush Sawal <ayush.sawal@chelsio.com>
Signed-off-by: NDevulapally Shiva Krishna <shiva@chelsio.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ee91ac1b
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册