]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: talitos - fix icv management on outbound direction
authorHoria Geanta <horia.geanta@freescale.com>
Thu, 2 Aug 2012 14:16:37 +0000 (17:16 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 28 Aug 2012 15:56:26 +0000 (23:56 +0800)
commitd84e0558279e3f6c1c34e404eed5851729d092d1
tree26c11e2662308780dc4719e4254111414ad9d194
parentaa846d5c5fc38ad08b71f9d724bdcf5c32e50d99
crypto: talitos - fix icv management on outbound direction

For IPsec encryption, in the case when:
-the input buffer is fragmented (edesc->src_nents > 0)
-the output buffer is not fragmented (edesc->dst_nents = 0)
the ICV is not output in the link table, but after the encrypted payload.

Copying the ICV must be avoided in this case; consequently the condition
edesc->dma_len > 0 must be more specific, i.e. must depend on the type
of the output buffer - fragmented or not.

Testing was performed by modifying testmgr to support src != dst,
since currently native kernel IPsec does in-place encryption
(src == dst).

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/talitos.c