aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKamil Konieczny <k.konieczny@partner.samsung.com>2018-01-18 19:34:03 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2018-02-15 23:23:46 +0800
commitf1b298103e141e70616a6f69bec922c669a2732f (patch)
tree58399a5110336f8ad8ee6b78ca3bc7c8f2b105ad /drivers
parentcrypto: ux500/hash - Add empty export and import (diff)
downloadlinux-dev-f1b298103e141e70616a6f69bec922c669a2732f.tar.xz
linux-dev-f1b298103e141e70616a6f69bec922c669a2732f.zip
crypto: bfin_crc - 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: Kamil Konieczny <k.konieczny@partner.samsung.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/crypto/bfin_crc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/crypto/bfin_crc.c b/drivers/crypto/bfin_crc.c
index bfbf8bf77f03..5ece3240531e 100644
--- a/drivers/crypto/bfin_crc.c
+++ b/drivers/crypto/bfin_crc.c
@@ -450,6 +450,16 @@ static int bfin_crypto_crc_digest(struct ahash_request *req)
return bfin_crypto_crc_finup(req);
}
+static int bfin_crypto_crc_noimport(struct ahash_request *req, const void *in)
+{
+ return -ENOSYS;
+}
+
+static int bfin_crypto_crc_noexport(struct ahash_request *req, void *out)
+{
+ return -ENOSYS;
+}
+
static int bfin_crypto_crc_setkey(struct crypto_ahash *tfm, const u8 *key,
unsigned int keylen)
{
@@ -487,6 +497,8 @@ static struct ahash_alg algs = {
.final = bfin_crypto_crc_final,
.finup = bfin_crypto_crc_finup,
.digest = bfin_crypto_crc_digest,
+ .export = bfin_crypto_crc_noexport,
+ .import = bfin_crypto_crc_noimport,
.setkey = bfin_crypto_crc_setkey,
.halg.digestsize = CHKSUM_DIGEST_SIZE,
.halg.base = {