Received: by 10.223.185.116 with SMTP id b49csp2299199wrg; Thu, 15 Feb 2018 09:27:47 -0800 (PST) X-Google-Smtp-Source: AH8x224OlhrxrADDRBd0H46b3RkwsR6xe+wpvFtNgwklOUhZ29xqkrirKfD3muzU5TLFHRtjfcih X-Received: by 10.98.156.71 with SMTP id f68mr3346626pfe.193.1518715666932; Thu, 15 Feb 2018 09:27:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518715666; cv=none; d=google.com; s=arc-20160816; b=MkzcVUbRorYUqGiySLTmUIysbVqPr6HiyLzPbX1idNqqz4nXNOGLq56XEQoRHdDqIy rtaN09zfPRdBNzfesleByZ/oKeAwa2ZoJ3krGLdaY8PwzqD+i/wlVkou82iLwIOIgqKD 4eIxxfRDyWH5A91HB6feRM5tEX15+Yy9ivjKxFlzb5l4bjuqdMqcl9rSzFZc2x2pap1M b1cbERmspYKHlIbVEWFuEqIhkjSbbpZkBaCwAcuzwGgvkXGlAVoGzTfinN6N5uEhOE4H oGKJQoZXmNsxLVPM89e0NEh0rJ1hyKGUMA70BAzEcqpZyw7ebXyjjgiVR7x7MMCBemS6 9UVA== 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=yiwGUdV4mQCvPKlg4ZI6pxfVx2Alc5EWP4MF/acepUQ=; b=Z4dgbqSrWQTJJLp9MX9/uhC/8VKN4dyhP3q9NtQjh2PNxeYeWfJxJUIfk4ZUR7XMIy 2Quy7HykiR+OJYdUqUMbeTTzL70Hs5eHD0ic5Se7KpupYm6XzJ5ioQVLR3Cvs6pfm0Zr Ghx7YZUQLjz3DqxIBAFqBvWs6crobMheyhS9wqn+RTp5VcpfOVpeVaqbhzAAYKQ+zA3t 5KZp85KDc+EXHreMKxw8c31sfBXIYXWOxihglkGgU3rgfWDMV9Xc8DKKm1qu/9jejPLg mDZqlN9KIUuiIhRy4ldeTCTm9hgbi56Sf4hVeeo+c3DWWOikbO5oMhiyhl1WJXkaGWt+ iE5Q== 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 g11si2574711pfm.79.2018.02.15.09.27.32; Thu, 15 Feb 2018 09:27:46 -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 S1165156AbeBOPer (ORCPT + 99 others); Thu, 15 Feb 2018 10:34:47 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:57238 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165143AbeBOPen (ORCPT ); Thu, 15 Feb 2018 10:34:43 -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 D6FCB1118; Thu, 15 Feb 2018 15:34:42 +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 115/195] crypto: cryptd - pass through absence of ->setkey() Date: Thu, 15 Feb 2018 16:16:46 +0100 Message-Id: <20180215151711.453276487@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 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 @@ -913,7 +913,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);