silicann / blickwerk-boot

linux kernel and u-boot sources for blickwerk sensors
0 stars 3 forks source link

Upstreaming mxs-dcp change? #16

Open sumpfralle opened 4 years ago

sumpfralle commented 4 years ago

The patch file 0006-crypto-mxs-dcp-fix-the-probe-failure-for-sha1-sha256.patch looks like a generic change. Maybe it is useful for others? Sadly the committer did not comment, which specific problem the change tries to solve.

@dangowrt: what do you think?

dangowrt commented 4 years ago

Seems to be already resolved upstream by:

commit ea9e7568f7a7f0a6695e046316132afe382969a8
Author: Dan Douglass <dan.douglass@nxp.com>
Date:   Tue Oct 2 19:01:48 2018 +0000

crypto: mxs-dcp - Implement sha import/export

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@nxp.com>

which adds

               .statesize      = sizeof(struct dcp_export_state),

to all supported hash algorithms.