Skip to content

Commit 1900c58

Browse files
Cyrille Pitchenherbertx
authored andcommitted
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: Cyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 952bce9 commit 1900c58

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/crypto/atmel-sha.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,7 @@ static int atmel_sha_final(struct ahash_request *req)
939939
if (err)
940940
goto err1;
941941

942+
dd->req = req;
942943
dd->flags |= SHA_FLAGS_BUSY;
943944
err = atmel_sha_final_req(dd);
944945
} else {

0 commit comments

Comments
 (0)