Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7715494ybi; Wed, 5 Jun 2019 23:52:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7T0Z1Uh3SiADfsSYLyDdxURAKgkKfr3LbSevKlLaDrTI5Vk8En6eIoW8NYHfkIAXRdDow X-Received: by 2002:a17:90a:f992:: with SMTP id cq18mr48310912pjb.54.1559803978377; Wed, 05 Jun 2019 23:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559803978; cv=none; d=google.com; s=arc-20160816; b=OmRrEVET2JnB0YNGcdtiURyW7EwxNmMUb0FZq75xPWB1qgy263nbUM0sdGvob/N0fP u3q+h5p2q85YTRWOya/YZtAFa1UUUKf7o+2JHVfTGKiNaH1bRNIm9XuMnXtyFJJSUvwV H78FlF8QnmeqE3PjPc2zieZWQeggWtR7cZmq+6+nlnf9Wj3E0DsSqqUc57P8fRQFWbC3 p6dxewLqA0abd5meXbFUTSke72EJCMmutGiW7+FPaEcLsxNPktg3eDUY/EI0f+E1v13v rW9JlS4V0WD2ljshNbsijU892RAzXcnKnipHDc2AlgnbqDXpAZYyt3hgaFJ2x+ThH9ER VmHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2dGSMcrsfzDUA1PFWnwnWpauaXWGa3vDO3UsAZC6DZ4=; b=EdmIaH0buDNvcw4oqCN4iMynmFVwzObDDtTfN6ONo0LGGrCpBa4lWLfs41h1iqqWXB KEFr4iZ/MEESqHnT0ihkPeafiPFFR1mUPpiXVgQpqzAWrRnMkpycDR8IRjPpH0YC/VzZ abYYFPoaSvROxDQ94qDNDfW593drRmzDvdnf7eQnm9LceWWNktq11S4RIcPX9vuBy3vE Rfdi39HA40mjcb/zCobCAwKWAwaAjEWL8abeXzSnT2Nll4LoMvrH+XbQOWb3NVjSlTvc uXGQeHBMhYCPnr+9t6ObxW7GK1/+5+Zq8RhLVBMvhe8RoEfyLxsBQoY5VY9PLEoxXRcF gs+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 h1si962443plr.116.2019.06.05.23.52.44; Wed, 05 Jun 2019 23:52:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726637AbfFFGwU (ORCPT + 99 others); Thu, 6 Jun 2019 02:52:20 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:38804 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfFFGwU (ORCPT ); Thu, 6 Jun 2019 02:52:20 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hYmG3-0006v0-6O; Thu, 06 Jun 2019 14:52:19 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hYmG3-0006j8-2N; Thu, 06 Jun 2019 14:52:19 +0800 Date: Thu, 6 Jun 2019 14:52:19 +0800 From: Herbert Xu To: Elena Petrova Cc: linux-crypto@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] crypto: arm64/sha2-ce - correct digest for empty data in finup Message-ID: <20190606065219.cgwxy3rcnzzux3zc@gondor.apana.org.au> References: <20190528143506.212198-1-lenaptr@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190528143506.212198-1-lenaptr@google.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, May 28, 2019 at 03:35:06PM +0100, Elena Petrova wrote: > The sha256-ce finup implementation for ARM64 produces wrong digest > for empty input (len=0). Expected: the actual digest, result: initial > value of SHA internal state. The error is in sha256_ce_finup: > for empty data `finalize` will be 1, so the code is relying on > sha2_ce_transform to make the final round. However, in > sha256_base_do_update, the block function will not be called when > len == 0. > > Fix it by setting finalize to 0 if data is empty. > > Fixes: 03802f6a80b3a ("crypto: arm64/sha2-ce - move SHA-224/256 ARMv8 implementation to base layer") > Cc: stable@vger.kernel.org > Signed-off-by: Elena Petrova > Reviewed-by: Ard Biesheuvel > --- > arch/arm64/crypto/sha2-ce-glue.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt