Received: by 10.223.148.5 with SMTP id 5csp7879454wrq; Thu, 18 Jan 2018 10:37:48 -0800 (PST) X-Google-Smtp-Source: ACJfBouTQI/TMBlwA0GSOS0aH8jYDfXAY+9PjEUZlZK30DsgVeNMRPUB5jKqvH+vBbvh5yhez55b X-Received: by 2002:a17:902:5a1:: with SMTP id f30-v6mr236210plf.124.1516300668417; Thu, 18 Jan 2018 10:37:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516300668; cv=none; d=google.com; s=arc-20160816; b=ZDMPg5TBRS3EcGeOmmG31IiP9q2CeyX44X/C/O/YZu1a15SPMGkZGG/wCxTaEx39Z5 Pe8yVfPHD4+nmsgqv2ITSLVE36hA7ql53oh9mH1zPWsUWZ6JeO5Pa6OdwJSmEtblnmUi 61IAApfv/GMCbK3mkP+ZFVgjaUvNirybt+VPyZ5O57+HozL1yZUUqmlP8NCmymSPD5ed cLC+vxanvi2BGTNMCJ0MEnyhgVsddFvSdCz0ZYGEwZQweG1ANT85ONLc70P58r+PAZga jB9Rozyb86CEb6x+tkmybYbCMgy28/iOOjP+E+ofIFIHHk073eGmYz5aI7hb+Z0mpM3e tLTA== 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=AQMgh5ldDIuEA3XLIWOm3b3acWP7Ei/vU2ilU22l0x8=; b=AUFi+JecVJnVs3lWwwIAVttjvXX9y++9ewzDyLwIL8zlxledNvlwrT5TYjEGrJB3Tu wYv3cnffra0oH73DHKQ55W9cP4S79O5+jx1SjZcFMqSSUAvPpS91z2kltFnZWVzfXa61 9Ji8kDYFCTv0IF7Q/R8kwOgeygXv3FQu+zIAd8/WV2eGQJeItgwGMP/hha7bNXHaDOiC 8pR071UyXJ0fTMPgQBnrcOai1+arhAzyjgwTMqQ9IlJJ2aZZzLu9RaigmWVV8R73VXPm d8ot2fcD6P8Zlj71ufM6Z3k4JztxEppRD3Eyhy7Y5MYrEJBAGW1vO8qlyp0WGmSn2LOM 1Qaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=rdvZ6s31; 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 q3-v6si105958pll.231.2018.01.18.10.37.34; Thu, 18 Jan 2018 10:37:48 -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=rdvZ6s31; 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 S1756096AbeARSgn (ORCPT + 99 others); Thu, 18 Jan 2018 13:36:43 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33220 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755571AbeARSeo (ORCPT ); Thu, 18 Jan 2018 13:34:44 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180118183441euoutp012c22143bf746f6dadbfbf81ed038bf8a~K_0ErBp5_1296612966euoutp01H; Thu, 18 Jan 2018 18:34:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180118183441euoutp012c22143bf746f6dadbfbf81ed038bf8a~K_0ErBp5_1296612966euoutp01H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1516300481; bh=AQMgh5ldDIuEA3XLIWOm3b3acWP7Ei/vU2ilU22l0x8=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=rdvZ6s31tDVohuNtn1dNBfSqmAcq4VsCCmoIJX34m7xOGqhGasUwzulZuJFX3BGyi S86bYbCdGOZflVd9FGVFY2Lh+wYuI9WxC6JuxlcvMEPQzH+sU3/GqRL6/VXMP44koo AvDLP4EEwmT3iI27l4rPpMQDdzV8zga+NJXZsiGI= Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180118183440eucas1p22cbdbb04ab9d5ef6dad8598b6d057e83~K_0D0hQwp0763107631eucas1p2B; Thu, 18 Jan 2018 18:34:40 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id C5.91.12907.0C8E06A5; Thu, 18 Jan 2018 18:34:40 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180118183440eucas1p21e1a425cbafe3cbb3856d97fd94228e5~K_0DEtNy-0522605226eucas1p2S; Thu, 18 Jan 2018 18:34:40 +0000 (GMT) X-AuditID: cbfec7f1-f793a6d00000326b-47-5a60e8c043eb Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F2.61.20118.0C8E06A5; Thu, 18 Jan 2018 18:34:40 +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:40 +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 3/5] crypto: ux500/hash: Add empty export and import Date: Thu, 18 Jan 2018 19:34:02 +0100 Message-id: <20180118183404.12583-4-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+NgFmplleLIzCtJLcpLzFFi42LZduznOd0DLxKiDF59UbG41ruQ2WLjjPWs FnPOt7BYzOrSteh+JWPR9PItk8XnVU9ZLPr2/We0mPJnOZPF/Xs/mSwu75rDZvGmrZHR4um6 JcwWd7Y2s1kcmbKP1YHfo/XSXzaPV1cdPbasvMnkMW/WCRaPf4f7mTx2zrrL7rHtgKrHxmfP WTzuXNvD5nHw3R4mj74tqxg9Pm+SC+CJ4rJJSc3JLEst0rdL4Mr4sN+iYK1YxeHZ31kbGGcI dTFyckgImEj8eDSDCcIWk7hwbz1bFyMXh5DAUkaJnjmnWSCcz4wS/z7OZILp6F1/GKpqGaPE stN7GSGc/4wSE3pBWjg52ATMJR5tPwPUwcEhIqAgMe+rDkgNs8ABFokDZ3awgtQIC7hIvOte zQZiswioSmzY+J8RpJ4XKD55jyPEMnmJxd93gpVwCrhK3J57FWyXhMBnNoknLdOhLnKRuPth CyOELSzx6vgWdghbRuLy5G4WiIZ+RonlN06xQzhTGCWOT7sK1W0tcfj4RbCLmAX4JCZtm84M coWEAK9ERxs0kDwk2t5vhVrgKDHjxidmiI9nMEpsWtfEPoFRegEjwypGkdTS4tz01GIjveLE 3OLSvHS95PzcTYzAxHH63/GPOxjfn7A6xCjAwajEw7thcUKUEGtiWXFl7iFGCQ5mJRHed95A Id6UxMqq1KL8+KLSnNTiQ4zSHCxK4ry2UW2RQgLpiSWp2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eucas1p21e1a425cbafe3cbb3856d97fd94228e5 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180118183440eucas1p21e1a425cbafe3cbb3856d97fd94228e5 X-RootMTR: 20180118183440eucas1p21e1a425cbafe3cbb3856d97fd94228e5 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 Acked-by: Linus Walleij --- drivers/crypto/ux500/hash/hash_core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 9acccad26928..2d0a677bcc76 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1403,6 +1403,16 @@ static int ahash_sha256_digest(struct ahash_request *req) return ret1 ? ret1 : ret2; } +static int ahash_noimport(struct ahash_request *req, const void *in) +{ + return -ENOSYS; +} + +static int ahash_noexport(struct ahash_request *req, void *out) +{ + return -ENOSYS; +} + static int hmac_sha1_init(struct ahash_request *req) { struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); @@ -1507,6 +1517,8 @@ static struct hash_algo_template hash_algs[] = { .update = ahash_update, .final = ahash_final, .digest = ahash_sha1_digest, + .export = ahash_noexport, + .import = ahash_noimport, .halg.digestsize = SHA1_DIGEST_SIZE, .halg.statesize = sizeof(struct hash_ctx), .halg.base = { @@ -1529,6 +1541,8 @@ static struct hash_algo_template hash_algs[] = { .update = ahash_update, .final = ahash_final, .digest = ahash_sha256_digest, + .export = ahash_noexport, + .import = ahash_noimport, .halg.digestsize = SHA256_DIGEST_SIZE, .halg.statesize = sizeof(struct hash_ctx), .halg.base = { @@ -1553,6 +1567,8 @@ static struct hash_algo_template hash_algs[] = { .final = ahash_final, .digest = hmac_sha1_digest, .setkey = hmac_sha1_setkey, + .export = ahash_noexport, + .import = ahash_noimport, .halg.digestsize = SHA1_DIGEST_SIZE, .halg.statesize = sizeof(struct hash_ctx), .halg.base = { @@ -1577,6 +1593,8 @@ static struct hash_algo_template hash_algs[] = { .final = ahash_final, .digest = hmac_sha256_digest, .setkey = hmac_sha256_setkey, + .export = ahash_noexport, + .import = ahash_noimport, .halg.digestsize = SHA256_DIGEST_SIZE, .halg.statesize = sizeof(struct hash_ctx), .halg.base = { -- 2.15.0