From patchwork Thu Jan 18 18:34:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 10173823 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 39A52603B5 for ; Thu, 18 Jan 2018 18:35:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ADA328403 for ; Thu, 18 Jan 2018 18:35:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D69F28417; Thu, 18 Jan 2018 18:35:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA65A28403 for ; Thu, 18 Jan 2018 18:35:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755920AbeARSeq (ORCPT ); Thu, 18 Jan 2018 13:34:46 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33200 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755325AbeARSem (ORCPT ); Thu, 18 Jan 2018 13:34:42 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180118183440euoutp0179732bf1611fa13f3923b16bba4f2217~K_0DH6r4c1296612966euoutp01G; Thu, 18 Jan 2018 18:34:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180118183440euoutp0179732bf1611fa13f3923b16bba4f2217~K_0DH6r4c1296612966euoutp01G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1516300480; bh=9ICv3/oNeJm3CrG9+S0EdUjnOIcaJfJi2YaB2YJzqCU=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=f/1EarzazGOOHFtLeyo/bawofHme39jm4jnlOJQiBhSGBwz1w+ffZID7etbw5fb1N 9/9ssDVgYYuOiLlrRzcezyxj9GOyB1KUufT6R0C3zADmCJmxZYhfOyJpoY1Hywb7mQ or5WIqdOEI6L0uBt4XTt3QE0kcbcGfpcnw8qukTc= Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180118183439eucas1p112cb52eb1d5b401fd2dbf00d50f3fe19~K_0CgSTIW1373713737eucas1p1D; Thu, 18 Jan 2018 18:34:39 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 18.13.12743.FB8E06A5; Thu, 18 Jan 2018 18:34:39 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180118183438eucas1p27a0802d5d4ce9013cff72e0ddaccd630~K_0B2hoav0522605226eucas1p2N; Thu, 18 Jan 2018 18:34:38 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d0000031c7-7e-5a60e8bfe4ac Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 93.C2.18832.EB8E06A5; Thu, 18 Jan 2018 18:34:38 +0000 (GMT) Received: from AMDC3218.DIGITAL.local ([106.120.51.18]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P2R00FS4KXJWN40@eusync1.samsung.com>; Thu, 18 Jan 2018 18:34:38 +0000 (GMT) From: Kamil Konieczny To: linux-crypto@vger.kernel.org Cc: Kamil Konieczny , "David S. Miller" , Bartlomiej Zolnierkiewicz , Marek Vasut , Sonic Zhang , Fabio Estevam , Shawn Guo , Tom Lendacky , Jan Engelhardt , Arvind Yadav , Linus Walleij , Joakim Bech , linux-kernel@vger.kernel.org, Herbert Xu Subject: [PATCH v3 1/5] crypto: mxs-dcp: Add empty hash export and import Date: Thu, 18 Jan 2018 19:34:00 +0100 Message-id: <20180118183404.12583-2-k.konieczny@partner.samsung.com> X-Mailer: git-send-email 2.15.0 In-reply-to: <20180118183404.12583-1-k.konieczny@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjleLIzCtJLcpLzFFi42LZduznOd39LxKiDBacErC41ruQ2WLjjPWs FnPOt7BYzOrSteh+JWPR9PItk8XnVU9ZLPr2/We0mPJnOZPF/Xs/mSwu75rDZvGmrZHR4um6 JcwWd7Y2s1kcmbKP1YHfo/XSXzaPV1cdPbasvMnkMW/WCRaPf4f7mTx2zrrL7rHtgKrHxmfP WTzuXNvD5nHw3R4mj74tqxg9Pm+SC+CJ4rJJSc3JLEst0rdL4Mr4MaeRpaCDv+Ln9nVMDYwb eLoYOTkkBEwk+tqus0HYYhIX7q0Hsrk4hASWMkrMWvKdCcL5zCjx+/llFpiO+a++sEIkljFK 3J22nBHC+c8o0bSoH2wWm4C5xKPtZ4DaOThEBBQk5n3VAalhFjjAInHgzA5WkBphAU+Jieu+ s4DUsAioSlz8LwgS5hVwkdi9bhvUSfISi7/vBLM5BVwlbs+9CrZLQuA3m8S/G2+YIIpcJOa0 fWWFsIUlXh3fwg5hy0h0dhxkgmjoZ5RYfuMUO4QzhVHi+LSrUN3WEoePXwTrZhbgk5i0bToz yEUSArwSHW1CECUeEo3tE5ghbEeJz+9fQL0/g1Hi77xDzBMYpRcwMqxiFEktLc5NTy021StO zC0uzUvXS87P3cQITB2n/x3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Kf0LXaJh1/506L9uOk51qiZt4S6xfH Pz0rtHTqvrUyK72VWIozEg21mIuKEwFzKH3nawIAAA== X-CMS-MailID: 20180118183438eucas1p27a0802d5d4ce9013cff72e0ddaccd630 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180118183438eucas1p27a0802d5d4ce9013cff72e0ddaccd630 X-RootMTR: 20180118183438eucas1p27a0802d5d4ce9013cff72e0ddaccd630 References: <20180118183404.12583-1-k.konieczny@partner.samsung.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 = {