]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
crypto: stm32/cryp - fix lrw chaining mode
authorNicolas Toromanoff <nicolas.toromanoff@foss.st.com>
Tue, 30 Nov 2021 07:54:59 +0000 (08:54 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 09:59:33 +0000 (10:59 +0100)
commit0b735a9ac8490ce89b771cd1dc0358032c9f1407
tree63c24f6647825ae049be5ae1f2a5cbcb69775bcf
parent6a9f9df9978b53218d813d20c99dc30cde23c8e7
crypto: stm32/cryp - fix lrw chaining mode

BugLink: https://bugs.launchpad.net/bugs/1959376
[ Upstream commit fa97dc2d48b476ea98199d808d3248d285987e99 ]

This fixes the lrw autotest if lrw uses the CRYP as the AES block cipher
provider (as ecb(aes)). At end of request, CRYP should not update the IV
in case of ECB chaining mode. Indeed the ECB chaining mode never uses
the IV, but the software LRW chaining mode uses the IV field as
a counter and due to the (unexpected) update done by CRYP while the AES
block process, the counter get a wrong value when the IV overflow.

Fixes: 5f49f18d27cd ("crypto: stm32/cryp - update to return iv_out")
Signed-off-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/crypto/stm32/stm32-cryp.c