Received: by 10.223.148.5 with SMTP id 5csp7877064wrq; Thu, 18 Jan 2018 10:35:52 -0800 (PST) X-Google-Smtp-Source: ACJfBouPyLTq9p72+aGPUyW/SjXVdVfzYFnpSkblNmOfbi9F+fkkuTZq+df2ecM39YpYvl346gmg X-Received: by 10.98.223.29 with SMTP id u29mr38971856pfg.166.1516300552559; Thu, 18 Jan 2018 10:35:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516300552; cv=none; d=google.com; s=arc-20160816; b=XJQntJ0ZFfdJ+PwHHpMVQdi731hbL7j4otDtpFkpZ6AGvW0KRs+KT6UoIGO737pIaR PUAvZE3uIcfkXrnLj2jHtxqbDF0TZaaWmIA5s5nfPQs2XkqRgl00tjqLpSwzGuy95uK/ ZxGJ9W8ST/1/lzhmquCmUvvMn5y6oB0NyjGWS2m0jYRrpVhrFG6Vv+zdDuu/tJ4aXCwV LAVfddcZm+oxiqDgJSukJS7fRAjA8ayRwRZkvOYf/sFu8oYeccgJZrbEzhfukml2XIaK aAoNwgpQG6p/iGbq/C8812MTcNbO6rNbieSEj89D3rIg+S5+eMwy2L2Wez4WhPibx+yT mTgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=9ICv3/oNeJm3CrG9+S0EdUjnOIcaJfJi2YaB2YJzqCU=; b=K3E9sXojs5tXHmxAXEZlFH4I1qv6SulOd7Nfs9girGi5VnBHcZxowXxf2ziekn9p36 8oHLiGqwluxk+g/iL2qZLtu2rxKLfDpzXOJHHuPNR66fXrB3ARPiFXa09W6KjpTqS1Z0 BOy9Tx/kZclxy6lH/D3y3tcMrz9H5jFTXu2EKXemYc2m4k8EXlyN0q/KBvwB7hm4opOY oi+uxGMkgvqztGdq7dDhpFUOM56wXv7YIaKxoyX1l3cWNTjyLNMAR8ACNijTmFMmPtyf T965bJvHcS/FvE+R1vYM+ic6jafCT/rvV0kAIKR4dN/3ebB2/4+uC4wrhFXs1JIfiZ6I NGyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=f/1Earza; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si7429143pff.4.2018.01.18.10.35.38; Thu, 18 Jan 2018 10:35:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=f/1Earza; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756004AbeARSet (ORCPT + 99 others); Thu, 18 Jan 2018 13:34:49 -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/uoNx6TGrQ4wCHIxKPLwbFidECbEmlhVX5h5ilOBgVhLhfecN FOJNSaysSi3Kjy8qzUktPsQozcGiJM5rG9UWKSSQnliSmp2aWpBaBJNl4uCUamBMYnGyyrob r3rB337xdM6zTSeuN++9bGtWxf33W4X6iokak2dtjTdnuXXoUnXS3omaCnMerHjanbpGLMFk v8ipy5KTW0/9vPB3n5vUg5+7V4qkrI6bzc/ZprNDYMebNR/lQ/9Znkh2vPbiw9yAR/UrGs6V 2GrHGdlzvReT1oj4kuOimZzs4/NNiaU4I9FQi7moOBEAGZuYQRkDAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBLMWRmVeSWpSXmKPExsVy+t/xy7r7XiREGTxebWRxrXchs8XGGetZ Leacb2GxmNWla9H9Ssai6eVbJovPq56yWPTt+89oMeXPciaL+/d+Mllc3jWHzeJNWyOjxdN1 S5gt7mxtZrM4MmUfqwO/R+ulv2wer646emxZeZPJY96sEywe/w73M3nsnHWX3WPbAVWPjc+e s3jcubaHzePguz1MHn1bVjF6fN4kF8ATxWWTkpqTWZZapG+XwJXxY04jS0EHf8XP7euYGhg3 8HQxcnJICJhIzH/1hRXCFpO4cG89WxcjF4eQwBJGia5VV1khnEYmiTnH7jOBVLEJmEs82n4G yObgEBFQkJj3VQekhlngCIvE7oXrWEBqhAU8JSau+84CUsMioCpx8b8gSJhXwEVi97ptbBDL 5CUWf98JZnMKuErcnnuVEaRcCKhmxVn5CYy8CxgZVjGKpJYW56bnFhvqFSfmFpfmpesl5+du YgSG97ZjPzfvYLy0MfgQowAHoxIP74bFCVFCrIllxZW5hxglOJiVRHjfeQOFeFMSK6tSi/Lj i0pzUosPMUpzsCiJ8/buWR0pJJCeWJKanZpakFoEk2Xi4JRqYOysz18wY2bNAY547n8P1/4N Wb+475DYZO302/VLpE4s6Hj6SJQ3TjTi2ZuOKhEz48WFb5rVfx5+2fVAb/mjTSUxF19dLfTL MnpYYibN8viHXe6ePReefix/++TQD4v7y/tcvAJFvrKf0LXaJh1/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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = { -- 2.15.0