]> git.proxmox.com Git - mirror_ubuntu-eoan-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)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:23:30 +0000 (14:23 -0300)
commitddd5e1f21bd142161c86d176e2c9477765454ab7
tree28b6d4dca505fb2c0d782179aff1305c67d4ee76
parent035571ded37e3641e21000dd1e1990f7822210a5
crypto: geode-aes - switch to skcipher for cbc(aes) fallback

BugLink: https://bugs.launchpad.net/bugs/1856334
commit 504582e8e40b90b8f8c58783e2d1e4f6a2b71a3a upstream.

Commit 79c65d179a40e145 ("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: 79c65d179a40e145 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/crypto/geode-aes.c
drivers/crypto/geode-aes.h