Received: by 10.223.185.116 with SMTP id b49csp2297885wrg; Thu, 15 Feb 2018 09:26:33 -0800 (PST) X-Google-Smtp-Source: AH8x224qJ/PNleEjn8jS5qJh9anurV7VBOmx4HNCD+mXF4mI9tfNnH5stDgW9/iG0aecbprDI2ra X-Received: by 2002:a17:902:8e83:: with SMTP id bg3-v6mr3262357plb.246.1518715593408; Thu, 15 Feb 2018 09:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518715593; cv=none; d=google.com; s=arc-20160816; b=NuD5sJ+0iFRf4MSY01y7UYFHls5rlIAbTLG9NKqyyTuTlGkuvaetoWbw7Z43jTOpQE l92x8A/y6etJxw+C0ux/kM5Q4bbhcZF9vxzW5eUf5jP2ZKwKTtSx9HXV4p0xY5tmCWp2 o7E0K6q2IUj0VaxFJ32Vq6FYkXK749tX1sZDAOH7qmeEisMYTuiHuEXWMC2BE8DEr3iL lOquTXrGPtvgaq7p4i6Xjw4jE5a4Kb3zjkeHZygundNTmkU21O52dzBX/SUKITzh6ze7 RtwSfT4fUDb/F/oDSQjJQeDIIn5rFr+oR9uHj5lLFx5focbphwhfBaTeq/ZOv3+rlMps M86A== 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=r6Zgo+qnpqdhYkolyi/WSL1JZuKku/Fmx5Dwa2sRPLo=; b=xvRB+GJ/xD5xcmO5UyAojUC7cAwe5c55J5FkbEH/z6NDe48uW3mJwVHbQQt6MSOWYv vlkEYLA+W+yHxPAXodNFHK/+QmQbfY0Ow3ukVjObcAxDYOYoGvh/OzVJqu9meuxtYY8v nY+Yc3zyB88ISUulUiJpAKsiaiLzSYx+DpvP5ujcUs9YbZtc//jEmuoTtLBUIBwRtyLx hjA3VfiJ+mPHQMnacX+1BPy+saf+TouGhDxUHYhgFA8cgwJGqe9CFJ9jGz8Kdv/qncCW fCBp9glg996AMDYqCNF36C21vDuLFRhCriDF37TP7f3jI+5YEkfUdfc21zp8Knc2rpaZ 60MA== 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 g12si1622731pfk.368.2018.02.15.09.26.18; Thu, 15 Feb 2018 09:26:33 -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 S1427281AbeBORYf (ORCPT + 99 others); Thu, 15 Feb 2018 12:24:35 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:57280 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165143AbeBOPes (ORCPT ); Thu, 15 Feb 2018 10:34:48 -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 3A8311119; Thu, 15 Feb 2018 15:34:48 +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.14 116/195] crypto: mcryptd - pass through absence of ->setkey() Date: Thu, 15 Feb 2018 16:16:47 +0100 Message-Id: <20180215151711.492621983@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151705.738773577@linuxfoundation.org> References: <20180215151705.738773577@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Biggers commit fa59b92d299f2787e6bae1ff078ee0982e80211f upstream. When the mcryptd template is used to wrap an unkeyed hash algorithm, don't install a ->setkey() method to the mcryptd instance. This change is necessary for mcryptd 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/mcryptd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/crypto/mcryptd.c +++ b/crypto/mcryptd.c @@ -535,7 +535,8 @@ static int mcryptd_create_hash(struct cr inst->alg.finup = mcryptd_hash_finup_enqueue; inst->alg.export = mcryptd_hash_export; inst->alg.import = mcryptd_hash_import; - inst->alg.setkey = mcryptd_hash_setkey; + if (crypto_hash_alg_has_setkey(halg)) + inst->alg.setkey = mcryptd_hash_setkey; inst->alg.digest = mcryptd_hash_digest_enqueue; err = ahash_register_instance(tmpl, inst);