Re: [PATCH v2 06/14] crypto: caam - check assoclen

2019-07-19 Thread Herbert Xu
On Fri, Jul 19, 2019 at 03:06:38PM +, Horia Geanta wrote: > > Herbert, is it worth having these checks moved to crypto API, > so they could be shared b/w all implementations? Yes this should be turned into a inline helper. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~

Re: [PATCH v2 06/14] crypto: caam - check assoclen

2019-07-19 Thread Horia Geanta
On 7/19/2019 2:58 AM, Iuliana Prodan wrote: [...] > --- a/drivers/crypto/caam/common_if.c > +++ b/drivers/crypto/caam/common_if.c > @@ -66,6 +66,23 @@ int check_rfc4106_authsize(unsigned int authsize) > } > EXPORT_SYMBOL(check_rfc4106_authsize); > > +/* > + * validate assoclen for RFC4106/RFC45

[PATCH v2 06/14] crypto: caam - check assoclen

2019-07-18 Thread Iuliana Prodan
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, exte