提交 1900c583 编写于 作者: C Cyrille Pitchen 提交者: Herbert Xu

crypto: atmel-sha - fix crash when computing digest on empty message

This patch fixes a crash which occured during the computation of the
digest of an empty message.

Indeed, when processing an empty message, the atmel_sha_handle_queue()
function was never called, hence the dd->req pointer remained
uninitialized.

Later, when the atmel_sha_final_req() function was called, it used
to crash while using this uninitialized dd->req pointer.

Hence this patch adds missing initializations of dd->req before calls of
the atmel_sha_final_req() function.

This bug prevented us from passing the tcrypt test suite on SHA algo.
Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 952bce97
...@@ -939,6 +939,7 @@ static int atmel_sha_final(struct ahash_request *req) ...@@ -939,6 +939,7 @@ static int atmel_sha_final(struct ahash_request *req)
if (err) if (err)
goto err1; goto err1;
dd->req = req;
dd->flags |= SHA_FLAGS_BUSY; dd->flags |= SHA_FLAGS_BUSY;
err = atmel_sha_final_req(dd); err = atmel_sha_final_req(dd);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册