Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751508AbeAPQc0 (ORCPT + 1 other); Tue, 16 Jan 2018 11:32:26 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:37989 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbeAPQcX (ORCPT ); Tue, 16 Jan 2018 11:32:23 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180116163220euoutp022ca6c7109b1c36557385a18e90644024~KV2rQTJBG2411024110euoutp02c X-AuditID: cbfec7f4-f790c6d0000075d3-7c-5a5e291351b8 To: Herbert Xu From: Kamil Konieczny Subject: [PATCH] crypto: ux500/hash: Add empty export and import Cc: "David S. Miller" , Linus Walleij , Bartlomiej Zolnierkiewicz , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Joakim Bech Message-id: Date: Tue, 16 Jan 2018 17:32:18 +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+NgFuplleLIzCtJLcpLzFFi42LZduzneV1hzbgogwmrzSw2zljPajHnfAuL RfcrGYvPq56yWEz5s5zJ4v69n0wWl3fNYXNg99iy8iaTx7YDqh53ru1h8+jbsorR4/MmuQDW KC6blNSczLLUIn27BK6M7XsnsRR8F6zY/nMDYwPjfr4uRk4OCQETidUbPjJC2GISF+6tZwOx hQSWMkpceSrSxcgFZH9mlDg5/y0jTEP7iy1MEEXLGCX2LeaAKHrGKPH2wwGwbhEBHYmVLxez gthsAuYSj7afAWsQFnCQ6LmzE2wQM8jUqZ3xIDavgJvEnMUr2EFsFgFVifffn4LViApESHQ9 28UKUSMo8WPyPRaIXk2JF18mQdniEs2tN6FseYnNa94ygxwkIbCHTeLx1F9sEFe7SEw4tgDK FpZ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qYKy+u1p77z7x rpNWX+4lMupNYRXhm8W3zEhtncTc5YIP2md+FbuZt1tqX6SSwwqjJUmWOjetpicnMLhdfr/8 2OpdWjEaM5fLN0ZUlc4v/Fqr/PaEkl+GnmlZpvjztasU/5vM6dxZdrP0pecBaadd/f0rd63n Dj6pHu9/bB5vyDQn51XvO3J8FymxFGckGmoxFxUnAgBObnP0awIAAA== X-CMS-MailID: 20180116163219eucas1p132fafc2db8cb9b3af1a1f22d8bf2fdaf X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180116163219eucas1p132fafc2db8cb9b3af1a1f22d8bf2fdaf X-RootMTR: 20180116163219eucas1p132fafc2db8cb9b3af1a1f22d8bf2fdaf References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Crypto framework will require async hash export/import, so add empty functions to prevent OOPS. Signed-off-by: Kamil Konieczny --- 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