crypto: stm32 - Fix empty message processing
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 11 Mar 2023 09:09:23 +0000 (17:09 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 17 Mar 2023 03:16:44 +0000 (11:16 +0800)
commit9fa4298a95ec42cb63dc5aaf2a8656bb23adf280
tree35600bc2069364e371e7f3afb9fda46c0f69f785
parent0280261f1f253d641bbd953247acfcfcad772e33
crypto: stm32 - Fix empty message processing

Change the emptymsg check in stm32_hash_copy_hash to rely on whether
we have any existing hash state, rather than whether this particular
update request is empty.

Also avoid computing the hash for empty messages as this could hang.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/stm32/stm32-hash.c