]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: geode-aes - switch to skcipher for cbc(aes) fallback
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 5 Oct 2019 09:11:10 +0000 (11:11 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 10 Oct 2019 12:42:45 +0000 (23:42 +1100)
commit358b27677d16c844de7471324374f78d4b02d3e0
tree052165945d9a93cce70e9cb8a58cf695484d1c29
parent693ceaa14db4548d4f0e9883450525a65f0d4c91
crypto: geode-aes - switch to skcipher for cbc(aes) fallback

Commit 6998e202d9b60cff ("crypto: cbc - Convert to skcipher") updated
the generic CBC template wrapper from a blkcipher to a skcipher algo,
to get away from the deprecated blkcipher interface. However, as a side
effect, drivers that instantiate CBC transforms using the blkcipher as
a fallback no longer work, since skciphers can wrap blkciphers but not
the other way around. This broke the geode-aes driver.

So let's fix it by moving to the sync skcipher interface when allocating
the fallback. At the same time, align with the generic API for ECB and
CBC by rejecting inputs that are not a multiple of the AES block size.

Fixes: 6998e202d9b60cff ("crypto: cbc - Convert to skcipher")
Cc: <stable@vger.kernel.org> # v4.20+ ONLY
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Florian Bezdeka <florian@bezdeka.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/geode-aes.c
drivers/crypto/geode-aes.h