OSDN Git Service

crypto: ccree - check assoclen for rfc4543
authorIuliana Prodan <iuliana.prodan@nxp.com>
Fri, 19 Jul 2019 07:09:23 +0000 (10:09 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 27 Jul 2019 11:08:36 +0000 (21:08 +1000)
commitb93ecf4296742c36192621645f59e4a607263233
tree0e74913b0366869b5b73ecbb0e8bbdf72b76a95e
parent6fc4dbcf0276279d488c5fbbfabe94734134f4fa
crypto: ccree - check assoclen for rfc4543

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

Validated assoclen for RFC4543 which expects an assoclen
of 16 or 20, the same as RFC4106.
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_aead.c