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)
commitfcd23ed57c4cccda17b0be736cdfbd7970b842c8
treedd736b7ee0a0990dc414d0fb35e9336c101a2cd8
parent68a51394f37ae8c6eb51209efc406355a9861874
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