Re: [RFC] crypto: mxs-dcp - Implement sha import/export

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2018-09-21 at 19:09 -0300, Fabio Estevam wrote:
> On Fri, Sep 21, 2018 at 5:13 PM, Leonard Crestez
> <leonard.crestez@xxxxxxx> wrote:
> > The mxs-dcp driver fails to probe if sha1/sha256 are supported:
> > 
> > [    2.455404] mxs-dcp 80028000.dcp: Failed to register sha1 hash!
> > [    2.464042] mxs-dcp: probe of 80028000.dcp failed with error -22
> > 
> > This happens because since commit 8996eafdcbad ("crypto: ahash - ensure
> > statesize is non-zero") import/export is mandatory and ahash_prepare_alg
> > fails on statesize == 0.
> > 
> > A set of dummy import/export functions were implemented in commit
> > 9190b6fd5db9 ("crypto: mxs-dcp - Add empty hash export and import") but
> > statesize is still zero and the driver fails to probe. That change was
> > apparently part of some unrelated refactoring.
> > 
> > Fix by actually implementing import/export.
> > 
> > Signed-off-by: Dan Douglass <dan.douglass@xxxxxxx>
> > Signed-off-by: Leonard Crestez <leonard.crestez@xxxxxxx>
> > 
> > ---
> >  drivers/crypto/mxs-dcp.c | 41 ++++++++++++++++++++++++++++++++--------
> >  1 file changed, 33 insertions(+), 8 deletions(-)
> > 
> > Patch is from NXP internal tree with minor adaptations, I can't vouch
> > for correctness. This only fixes probing, *TESTS DO NOT PASS* without
> > additional fixes dealing with HW limitations.
> > 
> > A branch that gets tcrypt to pass can be found here:
> > https://github.com/cdleonard/linux/commits/crypto_mxsdcp
> > I don't know if patches that make crypto drivers half-work are
> > acceptable, it can be argued that it's better to fail on probe and
> > fallback to software than to give incorrect results.
> 
> What about submitting a patch series that makes the mxs-dcp driver functional?

That's not very easy since I don't know much about crypto api and don't
understand the patches. From what I do know some of them look a bit
dubious, I'm not sure those issues can't be fixed more nicely by
increasing cra_alignmask and using fallbacks. I guess I could post the
entire thing as RFC?

I mostly just ported those patches to validate that "[PATCH] crypto:
mxs-dcp - Fix wait logic on chan threads" works.

--
Regards,
Leonard




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux