From: Marek Vasut <marex@denx.de>
To: Kamil Konieczny <k.konieczny@partner.samsung.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: mxs-dcp: Add empty hash export and import
Date: Tue, 16 Jan 2018 17:56:13 +0100 [thread overview]
Message-ID: <fbdc8a2b-4ed3-cc1c-246f-10c3c05a2ab0@denx.de> (raw)
In-Reply-To: <4f3389a1-d6aa-b3cc-2299-d638058ddd48@partner.samsung.com>
On 01/16/2018 05:16 PM, Kamil Konieczny wrote:
> Crypto framework will require async hash export/import, so add empty
> functions to prevent OOPS.
Shouldn't this be handled on the subsystem level with some
if (foo->bar)
foo->bar();
instead?
> Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
> ---
> drivers/crypto/mxs-dcp.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
> index 764be3e6933c..a10c418d4e5c 100644
> --- a/drivers/crypto/mxs-dcp.c
> +++ b/drivers/crypto/mxs-dcp.c
> @@ -759,6 +759,16 @@ static int dcp_sha_digest(struct ahash_request *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)
> {
> crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
> @@ -829,6 +839,8 @@ static struct ahash_alg dcp_sha1_alg = {
> .final = dcp_sha_final,
> .finup = dcp_sha_finup,
> .digest = dcp_sha_digest,
> + .import = dcp_sha_noimport,
> + .export = dcp_sha_noexport,
> .halg = {
> .digestsize = SHA1_DIGEST_SIZE,
> .base = {
> @@ -853,6 +865,8 @@ static struct ahash_alg dcp_sha256_alg = {
> .final = dcp_sha_final,
> .finup = dcp_sha_finup,
> .digest = dcp_sha_digest,
> + .import = dcp_sha_noimport,
> + .export = dcp_sha_noexport,
> .halg = {
> .digestsize = SHA256_DIGEST_SIZE,
> .base = {
>
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2018-01-16 16:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20180116161641eucas1p1f776ccf0d08da2d3b670e5b2ad550ea6@eucas1p1.samsung.com>
2018-01-16 16:16 ` [PATCH] crypto: mxs-dcp: Add empty hash export and import Kamil Konieczny
2018-01-16 16:56 ` Marek Vasut [this message]
2018-01-16 17:33 ` Kamil Konieczny
2018-01-16 17:28 ` Fabio Estevam
2018-01-16 18:28 ` Kamil Konieczny
2018-01-18 17:53 ` Kamil Konieczny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fbdc8a2b-4ed3-cc1c-246f-10c3c05a2ab0@denx.de \
--to=marex@denx.de \
--cc=b.zolnierkie@samsung.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=k.konieczny@partner.samsung.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox