Received: by 10.223.185.116 with SMTP id b49csp2378305wrg; Thu, 15 Feb 2018 10:41:03 -0800 (PST) X-Google-Smtp-Source: AH8x225Cg7iuMatvWmwZJklgBC+PlYV/ay8tAo+ByxNBr/AnGxUGrvVjLkPPRLbfH1QV5dwgFvYQ X-Received: by 2002:a17:902:7485:: with SMTP id h5-v6mr3437219pll.236.1518720063161; Thu, 15 Feb 2018 10:41:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518720063; cv=none; d=google.com; s=arc-20160816; b=JLExPd0sY3Et1GXrshbbx+27w8X0IoDhtlvKk2D7iepPRgMayLE53nS1J5QyF1eYUB 08+6XG2pWzpN59w5VmD5bp8epaf7FnocnC9oEG9pAR+M0QUFMF8VU13gyVkvw00Rm394 sovbuIUbr1O0+AEEyvZHRD25db8VSmBH8N5HvpJgBjuSyHBOZBvXgggCnQHpqYwg19GS 6w1ibsFxOsV/PpNkjmNUOBy0jGHt3JVQZxRHV/ecWfHSek/HxdxQaqNSfqmfICqnA91S K42sFChiOVwRz0jAIX5rC+ee3V/FyNBJfqAMSaxINHsjq1K5AdoYRv7pVsmQ8lMYodMb b/zg== 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=58fIRHR8UFspMMwJva0KwqIneosyEpKy9CJye+C+HKU=; b=i1o0vWuhQZusb3f3WxonAlsV4TaZJbFY/qnvFV9qeYMcV1nMq7Q1YzcuSvtg5NhR8E U3dbLXcl4zEmihY/pgztHCDXeNL/O2YqIWkBqXiQ+CbxZggBmsQtCiDo3FJU1ZifgGYe 9bmnblkxMA6kdwzGniq81IcoCx2wjlJ5XtnJaTCwUAACFDHjepU85CCwdcV9SZ7SAwXF YnkJA/KLSXfOX4g49wRO5dMXQfu9PQjoy4Ae/5HSUna6v7TOncWk8X94ZU0Z5Feyn7iB FFw3BzDL3RfJx3qMu2xRSzZT+7xOrTNXtmx2bCktIfuV6NEgboiWUODGsxb+R/j/QxTY Hg4Q== 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 p189si1952582pfg.297.2018.02.15.10.40.48; Thu, 15 Feb 2018 10:41:03 -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 S1162815AbeBOPXy (ORCPT + 99 others); Thu, 15 Feb 2018 10:23:54 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51584 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162688AbeBOPXq (ORCPT ); Thu, 15 Feb 2018 10:23: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 E8C49EC7; Thu, 15 Feb 2018 15:23:27 +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.4 068/108] crypto: cryptd - pass through absence of ->setkey() Date: Thu, 15 Feb 2018 16:17:05 +0100 Message-Id: <20180215151231.878836858@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.267507937@linuxfoundation.org> References: <20180215151222.267507937@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.4-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 @@ -654,7 +654,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);