crypto: algif_skcipher - Fix stream cipher chaining
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 29 Nov 2023 04:27:04 +0000 (12:27 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Dec 2023 03:59:46 +0000 (11:59 +0800)
commit99bd99d3e3a7f73c1c01ef510d48730b3bdd2c4a
tree98fe2dd24296acfca5fdf37d05d7bf2ab682951c
parent47309ea1359115125d9cab17a279c8df72b47235
crypto: algif_skcipher - Fix stream cipher chaining

Unlike algif_aead which is always issued in one go (thus limiting
the maximum size of the request), algif_skcipher has always allowed
unlimited input data by cutting them up as necessary and feeding
the fragments to the underlying algorithm one at a time.

However, because of deficiencies in the API, this has been broken
for most stream ciphers such as arc4 or chacha.  This is because
they have an internal state in addition to the IV that must be
preserved in order to continue processing.

Fix this by using the new skcipher state API.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algif_skcipher.c
include/crypto/if_alg.h