]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: caam - check assoclen
authorIuliana Prodan <iuliana.prodan@nxp.com>
Wed, 31 Jul 2019 13:08:07 +0000 (16:08 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Aug 2019 05:11:47 +0000 (15:11 +1000)
commitc83c948865f2382ea37eff93b199cb07ef8df334
treedd736b7ee0a0990dc414d0fb35e9336c101a2cd8
parent5e42e74a58c93222268d515e4ed42fb4c1ff149b
crypto: caam - check assoclen

Check assoclen to solve the extra tests that expect -EINVAL to be
returned when the associated data size is not valid.

Validated assoclen for RFC4106 and RFC4543 which expects an assoclen
of 16 or 20.
Based on seqiv, IPsec ESP and RFC4543/RFC4106 the assoclen is sizeof IP
Header (spi, seq_no, extended seq_no) and IV len. This can be 16 or 20
bytes.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/caamalg_qi.c
drivers/crypto/caam/caamalg_qi2.c