Received: by 10.223.148.5 with SMTP id 5csp7877334wrq; Thu, 18 Jan 2018 10:36:06 -0800 (PST) X-Google-Smtp-Source: ACJfBotQ4fzMuZCLjRt+sjDLN6Ur2HUdaGmOhG6U+fLNoEOxLlBGoVT8xlp9p/Wcb0b7GAhVdsNU X-Received: by 2002:a17:902:a60d:: with SMTP id u13-v6mr229588plq.114.1516300566158; Thu, 18 Jan 2018 10:36:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516300566; cv=none; d=google.com; s=arc-20160816; b=cMaqHSCsCZmAAOTzeV6UeyKFAvnl9zh4+B2mRhtvcEe8QOQowRXTLx36RQfSYJ9ILG hAPfi1lK/JB9qCPmjaAHeMfHJF9uPagpN478wNwpgbSQ3ir+6/ZqJELDL7Q0jfsBp1S6 RtdD+tKkr2skAWzHUKLKz5VTPV/MC7G6pA54+TIoyTTj19kTZpOlPuzsVjri3PEwHwkt RXptIwABdhyUP9326rvv/cI+V8iDGrzUgOCOf2wqV38hbnTnfCOpYoF9hslTtBb/ZAcG xVKGOK/JhYamBA2gXbq1c/zq1qrXgjCRMQaSMc5c5Z7xw4K0rgIgxzbDVYazRL7p8MHS 4i5w== 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=b0PJ3cy95DHu6jjweBOZ9W9gQEEzjKEAwM1IaCpafjw=; b=IqHCYUDxvTzLfJnAmSE6UaSzA/hb+GyYyo2zSABxMq0vPlHMIrm7TAv+IyNNNcFcWw zolmrtMFzEzcavC36lagQbH1WaApThntm1+mF13kp/20TBVOlQ5VZJsn4rxJxrTARRiJ VuNQiQVCFRMexVp7Zc1fEL+0qL11YiAxo27YIelnx66qIoG/CKHeRrjQ2K6KJxbTNeiv rEVyTFwlEZkC9ZXRm5E6+czSPVLudfEhX8bCW2Mq38AM+NlvxCJH6Urtu5qA9RGkcohZ OMAr5dwGvmRQWFWae3Euv98EhNGoyuZI6ijwVoNQMYbh7h4Q4GrcZF50d3kF3VaHJE0Y L3Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Cvi2Otl/; 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 x189si5976716pgd.187.2018.01.18.10.35.52; Thu, 18 Jan 2018 10:36:06 -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=Cvi2Otl/; 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 S1756020AbeARSew (ORCPT + 99 others); Thu, 18 Jan 2018 13:34:52 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:44295 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755383AbeARSen (ORCPT ); Thu, 18 Jan 2018 13:34:43 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180118183440euoutp0259684f925858be2a6ff9885e197af56d~K_0D1j3vM2762227622euoutp02f; Thu, 18 Jan 2018 18:34:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180118183440euoutp0259684f925858be2a6ff9885e197af56d~K_0D1j3vM2762227622euoutp02f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1516300481; bh=b0PJ3cy95DHu6jjweBOZ9W9gQEEzjKEAwM1IaCpafjw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Cvi2Otl/j7FJHLUYTJk4Pdt5pQ2QdS773zrm+hXiucuwaY1M9MSJjRhZkcnWj+7Qw BeXXcI71olFpQTJ7YzhkgAaoTLb9anbrg5EIFaNxdAxjr5aw6Eio9Y2zNN2nN9LEDj MRfqxU47EXkeu0hp6PtGsfs7YDmG8Mc3qddMyYIM= Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180118183440eucas1p1881057a18c25f99ba0169215d246f96e~K_0DL6OYq1373713737eucas1p1F; Thu, 18 Jan 2018 18:34:40 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 19.13.12743.FB8E06A5; 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 20180118183439eucas1p26bfb3043619ddcbc25474ac98e5638ff~K_0CgCD4i0522605226eucas1p2Q; Thu, 18 Jan 2018 18:34:39 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d0000031c7-80-5a60e8bf3ecf Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F1.61.20118.FB8E06A5; Thu, 18 Jan 2018 18:34:39 +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:39 +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 2/5] crypto: n2_core: Add empty hash export and import Date: Thu, 18 Jan 2018 19:34:01 +0100 Message-id: <20180118183404.12583-3-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+NgFmplleLIzCtJLcpLzFFi42LZduzned0DLxKiDP7lWlzrXchssXHGelaL OedbWCxmdeladL+SsWh6+ZbJ4vOqpywWffv+M1pM+bOcyeL+vZ9MFpd3zWGzeNPWyGjxdN0S Zos7W5vZLI5M2cfqwO/Reukvm8erq44eW1beZPKYN+sEi8e/w/1MHjtn3WX32HZA1WPjs+cs Hneu7WHzOPhuD5NH35ZVjB6fN8kF8ERx2aSk5mSWpRbp2yVwZRyefZa1oIGvYsWHQ4wNjM+4 uxg5OSQETCRavv5lgrDFJC7cW8/WxcjFISSwlFHiyPzLUM5nRom7HVvZYTp6Nu1ngkgsY5SY /eUbK4Tzn1Hi8sZdYFVsAuYSj7afAari4BARUJCY91UHpIZZ4ACLxIEzO1hBaoQF3CSert7D BmKzCKhKHP/aDHYHr4CLxP85MDfJSyz+vhOshlPAVeL23KuMEPHvbBIr+10hbBeJtz86oeLC Eq+Ob4G6VEbi8uRuFpDFEgL9jBLLb5xih3CmMEocn3YVaoO1xOHjF8EuYhbgk5i0bTozyNUS ArwSHW1CECUeEn/nvoAqd5Q4MXUv1MczGCU+3znDOoFRegEjwypGkdTS4tz01GJTveLE3OLS vHS95PzcTYzAxHH63/GvOxiXHrM6xCjAwajEw7thcUKUEGtiWXFl7iFGCQ5mJRHed95AId6U xMqq1KL8+KLSnNTiQ4zSHCxK4ry2UW2RQgLpiSWp2ampBalFMFk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eucas1p26bfb3043619ddcbc25474ac98e5638ff X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180118183439eucas1p26bfb3043619ddcbc25474ac98e5638ff X-RootMTR: 20180118183439eucas1p26bfb3043619ddcbc25474ac98e5638ff 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/n2_core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c index 662e709812cc..80e9c842aad4 100644 --- a/drivers/crypto/n2_core.c +++ b/drivers/crypto/n2_core.c @@ -359,6 +359,16 @@ static int n2_hash_async_finup(struct ahash_request *req) return crypto_ahash_finup(&rctx->fallback_req); } +static int n2_hash_async_noimport(struct ahash_request *req, const void *in) +{ + return -ENOSYS; +} + +static int n2_hash_async_noexport(struct ahash_request *req, void *out) +{ + return -ENOSYS; +} + static int n2_hash_cra_init(struct crypto_tfm *tfm) { const char *fallback_driver_name = crypto_tfm_alg_name(tfm); @@ -1467,6 +1477,8 @@ static int __n2_register_one_ahash(const struct n2_hash_tmpl *tmpl) ahash->final = n2_hash_async_final; ahash->finup = n2_hash_async_finup; ahash->digest = n2_hash_async_digest; + ahash->export = n2_hash_async_noexport; + ahash->import = n2_hash_async_noimport; halg = &ahash->halg; halg->digestsize = tmpl->digest_size; -- 2.15.0