OSDN Git Service

crypto: talitos - fix AEAD processing.
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 21 May 2019 13:34:19 +0000 (13:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:52 +0000 (14:50 +0100)
commit7f548acecec2a32fd0b7eb5e565662c20e9abd91
treedc2692d6ac26956ac3e37fd52b55a5c897b5850c
parentd947f064b4feb08ab1e2f43e035ec62827c33581
crypto: talitos - fix AEAD processing.

[ Upstream commit e345177ded17611e36c067751d63d64bf106cb54 ]

This driver is working well in 'simple cases', but as soon as
more exotic SG lists are provided (dst different from src,
auth part not in a single SG fragment, ...) there are
wrong results, overruns, etc ...

This patch cleans up the AEAD processing by:
- Simplifying the location of 'out of line' ICV
- Never using 'out of line' ICV on encryp
- Always using 'out of line' ICV on decrypt
- Forcing the generation of a SG table on decrypt

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Fixes: aeb4c132f33d ("crypto: talitos - Convert to new AEAD interface")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/talitos.c
drivers/crypto/talitos.h