On Mon, Apr 16, 2018 at 10:07 AM, Horia Geantă <horia.geanta@xxxxxxx> wrote: > Sometimes the provided RSA input buffer provided is not stripped > of leading zeros. This could cause its size to be bigger than that > of the modulus, making the HW complain: > > caam_jr 2142000.jr1: 40000789: DECO: desc idx 7: > Protocol Size Error - A protocol has seen an error in size. When > running RSA, pdb size N < (size of F) when no formatting is used; or > pdb size N < (F + 11) when formatting is used. > > Fix the problem by stripping off the leading zero from input data > before feeding it to the CAAM accelerator. > > Fixes: 8c419778ab57e ("crypto: caam - add support for RSA algorithm") > Cc: <stable@xxxxxxxxxxxxxxx> # 4.8+ > Reported-by: Martin Townsend <mtownsend1973@xxxxxxxxx> > Link: https://lkml.kernel.org/r/CABatt_ytYORYKtApcB4izhNanEKkGFi9XAQMjHi_n-8YWoCRiw@xxxxxxxxxxxxxx > Signed-off-by: Horia Geantă <horia.geanta@xxxxxxx> Tested-by: Fabio Estevam <fabio.estevam@xxxxxxx>