From patchwork Tue Jan 16 10:35:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Konieczny X-Patchwork-Id: 10166425 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 0032B601E7 for ; Tue, 16 Jan 2018 10:35:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF8B0201F5 for ; Tue, 16 Jan 2018 10:35:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2A5620501; Tue, 16 Jan 2018 10:35:52 +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=ham 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 A6702201F5 for ; Tue, 16 Jan 2018 10:35:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751685AbeAPKfu (ORCPT ); Tue, 16 Jan 2018 05:35:50 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:52524 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611AbeAPKft (ORCPT ); Tue, 16 Jan 2018 05:35:49 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180116103547euoutp0232ee2d9907a6d352f10549456a9c7eda~KQ-W6uhld2262322623euoutp02T; Tue, 16 Jan 2018 10:35:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180116103547euoutp0232ee2d9907a6d352f10549456a9c7eda~KQ-W6uhld2262322623euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1516098947; bh=/JiRyaZDJk1TmHI2VAs1FEOOpbWwnHakmytiLLVjkss=; h=To:Cc:From:Subject:Date:References:From; b=mUyTnXfzcpV52yXCydqq9dm/K+QoLxdRRBizAwPAl1vPhEnz5wrwGAgOWe+hIvMVY VUO7QsIInJtb3kqQec752B9pwUw8xNu8ObVW9loiWaCKoXjkuTaUTBoH5z5RpfeCGe UdmiLT60nD6j/dGBPqZ7iql9drtyKz5mVMgYzd4A= Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180116103546eucas1p1ebdb08514315b3f74e24c1b33f23ea38~KQ-WGg9S62778227782eucas1p1o; Tue, 16 Jan 2018 10:35:46 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id E5.53.12743.285DD5A5; Tue, 16 Jan 2018 10:35:46 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180116103545eucas1p230af34b97f903f8dc7db5e634297f4f8~KQ-VYVWMS0377503775eucas1p2D; Tue, 16 Jan 2018 10:35:45 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d0000031c7-be-5a5dd5811019 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 34.A2.20118.185DD5A5; Tue, 16 Jan 2018 10:35:45 +0000 (GMT) Received: from [106.120.51.18] by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P2N002OE9FL8OC0@eusync4.samsung.com>; Tue, 16 Jan 2018 10:35:45 +0000 (GMT) To: Herbert Xu Cc: "David S. Miller" , Bartlomiej Zolnierkiewicz , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org From: Kamil Konieczny Subject: [RFT PATCH] crypto: ahash.c: Require export/import in ahash Message-id: <2a8e710f-9d1c-726b-3355-5d671e04cb68@partner.samsung.com> Date: Tue, 16 Jan 2018 11:35:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-version: 1.0 Content-type: text/plain; charset="utf-8" Content-language: en-US Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPIsWRmVeSWpSXmKPExsWy7djPc7pNV2OjDF5uYrXYOGM9q8Wc8y0s Ft2vZCzu3/vJZHF51xw2B1aPLStvMnlsO6Dq0bdlFaPH501yASxRXDYpqTmZZalF+nYJXBnr +5ezFizkreib38rawPiTq4uRk0NCwETi1uuX7BC2mMSFe+vZQGwhgaWMEj9fRnQxcgHZnxkl Xh09xALTsOnVEWaIxDJGiYYPd9khOp4xSny/HwViiwjoSKx8uZgVpIhZYCGjxI/+82BFbALm Eo+2n2ECsYUFXCRmNr5hBLF5Bdwkdp3eBDSVg4NFQFXi5zR3kLCoQIRE17NdrBAlghI/Jt8D O4JZQFPixZdJULa4RHPrTShbXmLzmrdgx0kILGGTmPqlmQ1kpgTQrq4L0RAPCEu8Or4F6mMZ icuTu1kg6vsZJZbfOMUO4UxhlDg+7SoTRJW1xOHjF1khNvBJTNo2nRliKK9ER5sQRImHxPPO /9AQcpS4v3wZCyRQYiV2LtrGNoFRbhaSH2Yh+WEWkh9mIflhASPLKkaR1NLi3PTUYlO94sTc 4tK8dL3k/NxNjMBkcfrf8a87GJceszrEKMDBqMTDa7EtJkqINbGsuDL3EKMEB7OSCG9jMFCI NyWxsiq1KD++qDQntfgQozQHi5I4r21UW6SQQHpiSWp2ampBahFMlomDU6qBkeX5ao3E/RaX y5UXv5S6GdWecuTmh4OW8mInXu+z0hDTMDb2cr7+O0Xoja7kzH+m1f/Uq1XWVfJW/9SLVPn8 qOrUyZ/HLqUtz+IV5jZffW3FEqNQLeNVHMfmdh/cWvR9l9wpK6MUgRT+RbesBByWTHnqxl1+ 3WjvesM1FnuD9d4KcGzN3RX0WomlOCPRUIu5qDgRAKJhk3kSAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBLMWRmVeSWpSXmKPExsVy+t/xa7qNV2OjDL7fUbLYOGM9q8Wc8y0s Ft2vZCzu3/vJZHF51xw2B1aPLStvMnlsO6Dq0bdlFaPH501yASxRXDYpqTmZZalF+nYJXBnr +5ezFizkreib38rawPiTq4uRk0NCwERi06sjzBC2mMSFe+vZuhi5OIQEljBK7L3/gh3CecYo cebHG1aQKhEBHYmVLxezgiSYBRYySkxafAwswSZgLvFo+xkmEFtYwEViZuMbRhCbV8BNYtfp TUArODhYBFQlfk5zBwmLCkRINM2cywpRIijxY/I9FpASZgF1iSlTckHCzALiEs2tN1kgbHmJ zWveMk9g5J+FpGMWQscsJB2zkHQsYGRZxSiSWlqcm55bbKRXnJhbXJqXrpecn7uJERi+2479 3LKDsetd8CFGAQ5GJR5ei20xUUKsiWXFlbmHGCU4mJVEeBuDgUK8KYmVValF+fFFpTmpxYcY pTlYlMR5e/esjhQSSE8sSc1OTS1ILYLJMnFwSjUwnm8rncLebPJVW8Pt8LJrP3mc9skG3L46 6dal2/e2vLIJ3q8crBMv/OjXp947yz2y922auuuI/rY5T3+r3m90P6Gmsb5MmfetvJuV6g72 P0WN6RaJ3RPdeLt36O+/mLTif0Mgx+Rv/3iUpa6saA+3D8vRNNyQ6vMjdM2hGT33ax99E1S/ Ok/nmBJLcUaioRZzUXEiACiJgJ1bAgAA X-CMS-MailID: 20180116103545eucas1p230af34b97f903f8dc7db5e634297f4f8 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180116103545eucas1p230af34b97f903f8dc7db5e634297f4f8 X-RootMTR: 20180116103545eucas1p230af34b97f903f8dc7db5e634297f4f8 References: 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 Export and import were optional in async hash. As drivers were rewritten, they become mandatory now, so correct init of ahash transformation. Signed-off-by: Kamil Konieczny --- Tested with crypto run-time self test on Odroid-U3 with Exynos 4412 CPU, with insmod s5p-sss.ko Please test with other crypto hash drivers. crypto/ahash.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/crypto/ahash.c b/crypto/ahash.c index 3a35d67de7d9..7a8906d5af53 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -434,16 +434,6 @@ static int ahash_def_finup(struct ahash_request *req) return ahash_def_finup_finish1(req, err); } -static int ahash_no_export(struct ahash_request *req, void *out) -{ - return -ENOSYS; -} - -static int ahash_no_import(struct ahash_request *req, const void *in) -{ - return -ENOSYS; -} - static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) { struct crypto_ahash *hash = __crypto_ahash_cast(tfm); @@ -451,8 +441,8 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) hash->setkey = ahash_nosetkey; hash->has_setkey = false; - hash->export = ahash_no_export; - hash->import = ahash_no_import; + hash->export = alg->export; + hash->import = alg->import; if (tfm->__crt_alg->cra_type != &crypto_ahash_type) return crypto_init_shash_ops_async(tfm); @@ -467,10 +457,6 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) hash->setkey = alg->setkey; hash->has_setkey = true; } - if (alg->export) - hash->export = alg->export; - if (alg->import) - hash->import = alg->import; return 0; }