Directly return from final sha3/keccak_final if no bytes are requested
authorPatrick Steuer <patrick.steuer@de.ibm.com>
Mon, 5 Aug 2019 14:53:16 +0000 (16:53 +0200)
committerPatrick Steuer <patrick.steuer@de.ibm.com>
Sun, 18 Aug 2019 19:06:03 +0000 (21:06 +0200)
commita890ef833d114da3430c2f2efd95e01714704d34
treefa4984fae9f1752c4876527c9bbb5a5070114899
parent5be78a88aa922a6c43a83a18dbe252c6a358b8e9
Directly return from final sha3/keccak_final if no bytes are requested

Requesting zero bytes from shake previously led to out-of-bounds write
on some platforms.

Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9433)
crypto/sha/sha3.c
providers/common/digests/sha3_prov.c