]> 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)
commit199eb9d32488a1f2751324b8f5dc58b830d64639
treedd736b7ee0a0990dc414d0fb35e9336c101a2cd8
parentfdb2298b1f0b660c98fbc244e7e3f0df01fbeb2e
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