[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <20180118183404.12583-5-k.konieczny@partner.samsung.com>
Date: Thu, 18 Jan 2018 19:34:03 +0100
From: Kamil Konieczny <k.konieczny@...tner.samsung.com>
To: linux-crypto@...r.kernel.org
Cc: Kamil Konieczny <k.konieczny@...tner.samsung.com>,
"David S. Miller" <davem@...emloft.net>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Marek Vasut <marex@...x.de>,
Sonic Zhang <sonic.zhang@...log.com>,
Fabio Estevam <fabio.estevam@...escale.com>,
Shawn Guo <shawn.guo@...aro.org>,
Tom Lendacky <thomas.lendacky@....com>,
Jan Engelhardt <jengelh@...i.de>,
Arvind Yadav <arvind.yadav.cs@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Joakim Bech <joakim.bech@...aro.org>,
linux-kernel@...r.kernel.org,
Herbert Xu <herbert@...dor.apana.org.au>
Subject: [PATCH 4/5] 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@...tner.samsung.com>
---
drivers/crypto/bfin_crc.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/crypto/bfin_crc.c b/drivers/crypto/bfin_crc.c
index a118b9bed669..65a8e07835e8 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 = {
--
2.15.0
Powered by blists - more mailing lists