Received: by 10.223.185.116 with SMTP id b49csp592461wrg; Fri, 16 Feb 2018 04:07:55 -0800 (PST) X-Google-Smtp-Source: AH8x227eRaUD8Ea1BQQrRggdZvINJuyV9gtL4eyjgzpZpxHdAu2KFwsCJWOPAo7RHN2MzKajMmOZ X-Received: by 10.98.215.12 with SMTP id b12mr5926908pfh.149.1518782875499; Fri, 16 Feb 2018 04:07:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518782875; cv=none; d=google.com; s=arc-20160816; b=SoqUSbv9eMB1AwRd1BLFT1Jnr/ndWSqyStGqpyB3KAxHChcVrzCM3dDAYgEjHjTko9 8Bm/CG/tB5ADUDGq8GmrJJ8XWYy+Uh4slL1yNV92Xx2f9Igqi2GrNDSZG2IUGQvVis64 2Zp67QXcaIs2WqHjP80Ndrm+KvrQdd6YbHIbgqcgAsOxjHQlYaWV+S92fAj9vi5Fq3oJ GwSlXVyd64IulgGb0lV149sWCvTRM781pChWE3TxTu15QK5NdQsalYj5nf+ye1LpGdej tOj1C2nswUFaMZh894w9fwa72ANsJktYShfNilXViBn5WMhO5gxPw5YWemwudJOQR7Wz 2X0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=7ld2aq6huFShKI8OSu7gniGiV/rVprczhs4cdLgGIj4=; b=yHJMpl7VjgCmZSk+RDYqGlDIX2NZAMND1w662qRVTJsDZcimLW6gLdZmTd7jDxZmwT YYHqKICJqUoUyuLAzgzSUl1wD6HARC2wIqKeWid4b0OxiEpOM3p5MSdVT1e4qUg4IVSX 4Z1OF+1pGG3fVr1OPfURTyhLpVUprWXB0OkwU5M742aTCcNx/i37jGhqdA5KVKHdifTN eoSZErqJ5IHRzLrRlu08M4ud6S3QP1gZxlDcAuLogaAnjzeLt4DAPefDgEzxpMjCE7TJ S0nw6lwPTQ/ihgw+8WxIaJr/DewXxZANyuWaFwjAh3OHSNDtreexBb0TDwd+U2dG/4DN 39ig== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1-v6si4699890plr.558.2018.02.16.04.07.41; Fri, 16 Feb 2018 04:07:55 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1166258AbeBOST6 (ORCPT + 99 others); Thu, 15 Feb 2018 13:19:58 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:53226 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163453AbeBOP0q (ORCPT ); Thu, 15 Feb 2018 10:26:46 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3CD33FB4; Thu, 15 Feb 2018 15:26:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Biggers , Herbert Xu Subject: [PATCH 4.9 32/88] crypto: cryptd - pass through absence of ->setkey() Date: Thu, 15 Feb 2018 16:16:59 +0100 Message-Id: <20180215151227.116313542@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.437136975@linuxfoundation.org> References: <20180215151222.437136975@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Biggers commit 841a3ff329713f796a63356fef6e2f72e4a3f6a3 upstream. When the cryptd template is used to wrap an unkeyed hash algorithm, don't install a ->setkey() method to the cryptd instance. This change is necessary for cryptd to keep working with unkeyed hash algorithms once we start enforcing that ->setkey() is called when present. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/cryptd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -691,7 +691,8 @@ static int cryptd_create_hash(struct cry inst->alg.finup = cryptd_hash_finup_enqueue; inst->alg.export = cryptd_hash_export; inst->alg.import = cryptd_hash_import; - inst->alg.setkey = cryptd_hash_setkey; + if (crypto_shash_alg_has_setkey(salg)) + inst->alg.setkey = cryptd_hash_setkey; inst->alg.digest = cryptd_hash_digest_enqueue; err = ahash_register_instance(tmpl, inst);