Received: by 10.223.185.116 with SMTP id b49csp2552716wrg; Thu, 15 Feb 2018 13:30:56 -0800 (PST) X-Google-Smtp-Source: AH8x225vHezH570yL3LIprEmqwpQr0cF1pvQT7d9smct6n0OFWqfIF63oakMikopZPW1lqCVmEvp X-Received: by 10.101.72.4 with SMTP id h4mr3284718pgs.386.1518730256659; Thu, 15 Feb 2018 13:30:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518730256; cv=none; d=google.com; s=arc-20160816; b=OZwgZFl4B1IImurTOFg4UvqprO9JT+/eY3ZHWWJT4vb/2JCh0YbMPizOmZI9BGsMCB c0u4fvDdCwK+JYohup3kCdGRoSQ4sbv+JzZhNxkSSCQ+cKuY+8KEXQnR6UWeIz7nyGct rq+nnK3PGEfmb2Db6Y9+BQ7etnzNPgY/ScfLvcmVd7jhVTZwOqddCwXyUn/wCzvao1p3 N6+0ZJ+ORMxcFRcou9SV/FQtbHqCbmqlnEg8OzNytXhxO1Vhs2h3m8XPbakcEEuy79+S kjK0g10KLeWHm3/WnAZjb5Cp3ZUfFbZbhjwXbHe7NLLwS4F7EpaJmFMvfPgZ0Ugzpzp2 E+wA== 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=gIv2DkhHG/sSP75RA1rJPCJsq4Y80YeBagkbHE0+e84=; b=D9vR8IMH8TFZ8b7TIUymvTBT8DV9MWEnrsh1MwiRAXOtB+VkMVWo3IBBYHpAyxlDQx zofWl3vBv7VpsrGPLND97sC22u1FY5KPbgMj9Isf65njNJl90k1oWer2I0SjRunMRA/g S13aIFd76t897Ktprs2QSGEvNwDwCzfo0xMpYtGMa/pbGqwR4pCgGhBq0nyD6Uiwi/ns TaE9xDywOGMhlNS6x4JRfic4oeqvpqyqXZ7w6MZZFhVO1oRuM4gWLk8TW+3x4irIaf9B 4+YxRFQqPYChiNG6flRSzKLCGGl7Z+KgL8amHh9SqUuWYKbZRfz5aCm4XVqI8M+KLrtQ H50Q== 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 c8si600123pfi.93.2018.02.15.13.30.42; Thu, 15 Feb 2018 13:30:56 -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 S1163478AbeBOP0w (ORCPT + 99 others); Thu, 15 Feb 2018 10:26:52 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:53232 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163369AbeBOP0t (ORCPT ); Thu, 15 Feb 2018 10:26:49 -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 81010FB4; Thu, 15 Feb 2018 15:26: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.9 33/88] crypto: mcryptd - pass through absence of ->setkey() Date: Thu, 15 Feb 2018 16:17:00 +0100 Message-Id: <20180215151227.257655460@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 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 @@ -534,7 +534,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);