提交 9190b6fd 编写于 作者: K Kamil Konieczny 提交者: Herbert Xu

crypto: mxs-dcp - Add empty hash export and import

Crypto framework requires export/import in async hash. If driver do not
implement them, wrapper functions in framework will be used, and it will
cause error during ahash alg registration (unless one disables crypto
internal tests). To make change in framework and expose this requirement,
I will remove wrappers from crypto/ahash.c , but this can broke code which
depends on them. Add empty hash export and import, with the same behaviour
as in framework and expose this directly in driver. This can also prevent
OOPS when config option in Cryptographic API 'Disable run-time self tests'
will be enabled.
Signed-off-by: NKamil Konieczny <k.konieczny@partner.samsung.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 c927b080
...@@ -759,6 +759,16 @@ static int dcp_sha_digest(struct ahash_request *req) ...@@ -759,6 +759,16 @@ static int dcp_sha_digest(struct ahash_request *req)
return dcp_sha_finup(req); return dcp_sha_finup(req);
} }
static int dcp_sha_noimport(struct ahash_request *req, const void *in)
{
return -ENOSYS;
}
static int dcp_sha_noexport(struct ahash_request *req, void *out)
{
return -ENOSYS;
}
static int dcp_sha_cra_init(struct crypto_tfm *tfm) static int dcp_sha_cra_init(struct crypto_tfm *tfm)
{ {
crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
...@@ -829,6 +839,8 @@ static struct ahash_alg dcp_sha1_alg = { ...@@ -829,6 +839,8 @@ static struct ahash_alg dcp_sha1_alg = {
.final = dcp_sha_final, .final = dcp_sha_final,
.finup = dcp_sha_finup, .finup = dcp_sha_finup,
.digest = dcp_sha_digest, .digest = dcp_sha_digest,
.import = dcp_sha_noimport,
.export = dcp_sha_noexport,
.halg = { .halg = {
.digestsize = SHA1_DIGEST_SIZE, .digestsize = SHA1_DIGEST_SIZE,
.base = { .base = {
...@@ -853,6 +865,8 @@ static struct ahash_alg dcp_sha256_alg = { ...@@ -853,6 +865,8 @@ static struct ahash_alg dcp_sha256_alg = {
.final = dcp_sha_final, .final = dcp_sha_final,
.finup = dcp_sha_finup, .finup = dcp_sha_finup,
.digest = dcp_sha_digest, .digest = dcp_sha_digest,
.import = dcp_sha_noimport,
.export = dcp_sha_noexport,
.halg = { .halg = {
.digestsize = SHA256_DIGEST_SIZE, .digestsize = SHA256_DIGEST_SIZE,
.base = { .base = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册