提交 0ee991be 编写于 作者: G Gary R Hook 提交者: Herbert Xu

crypto: ccp - Fill the result buffer only on digest, finup, and final ops

Any change to the result buffer should only happen on final, finup
and digest operations. Changes to the buffer for update, import, export,
etc, are not allowed.

Fixes: 66d7b9f6175e ("crypto: testmgr - test misuse of result in ahash")
Signed-off-by: NGary R Hook <gary.hook@amd.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 9cc16b4d
......@@ -46,7 +46,7 @@ static int ccp_aes_cmac_complete(struct crypto_async_request *async_req,
}
/* Update result area if supplied */
if (req->result)
if (req->result && rctx->final)
memcpy(req->result, rctx->iv, digest_size);
e_free:
......
......@@ -47,7 +47,7 @@ static int ccp_sha_complete(struct crypto_async_request *async_req, int ret)
}
/* Update result area if supplied */
if (req->result)
if (req->result && rctx->final)
memcpy(req->result, rctx->ctx, digest_size);
e_free:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册