Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7715187ybi; Wed, 5 Jun 2019 23:52:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQPXLij46tNOMJVyLHKLCApFtxsUfB1wYD0NSdOnFLxCHmEHhafjTsDxq3L+Yf2YwB6W0R X-Received: by 2002:a63:5e42:: with SMTP id s63mr1969536pgb.234.1559803956468; Wed, 05 Jun 2019 23:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559803956; cv=none; d=google.com; s=arc-20160816; b=e+NeEyH7u+Kzl79ZLh/9qcyyDlIxLLYppAsjKDOxh13f6zCyCyRAMnG1d9HBg0J/27 v30lgaEzjzMwMHFIbl5TF5S5/oAXxYWe0Ak+OFNRAMAqNAmET9fHOXGAx4UNM92z8bnv F+cCbLBqj91dOQzoIiFiuKcKAMSOjdYeMYlnFmCdZu+tptwMJzY2HptVLoa3ToM+1mMZ MWsre1OujkCOY4RPA40I5CZ7ilP3tsz4kyHYlsEHsgBwUvCXfhpG7awU7O+JgyMmJXaj tPqJ9IcOP4JuySCHIhZAdt03hgcr0NpbjrhuYyy7Po785siSBk+xhJf+Vm9QONSZ6kI7 dp5Q== 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=OVnZDlSSqo8mO7zOk7+IUssYSRzjTFYqkh0YVIVlyV4=; b=S5thQxPStEJkXc1fa2FNhdQ3LQEheFBFXipY5dQKCJ+IQdFCAtWuBufZ539MIt5BIu oe/mgw9n2FvUaBPfvKkOrnU5NNfu7k+plazHFugopisp3rXr05VzRQi2c9PjXsLhVWGx 4Uf2jANPlaDcjwtmZRSy1jY55KOkfYuNn5SHIE/I+uA8FPYwzkHJyVYJkAI/+BTpS69w kYzwWCwipJ4ZW88P/CoF6M03riVne3mA2gR8NWoJJ1lYsQnXjNTFXbuQgbcuPhkBItMC dWuq1lnWwzpR95EKHZtyZQH+rB/IwDUL+Ri5gZ+vUy6DXlP5VvND5//K3otCStezSXBv qF2g== 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 f16si1048837plr.340.2019.06.05.23.52.22; Wed, 05 Jun 2019 23:52:36 -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 S1726633AbfFFGwP (ORCPT + 99 others); Thu, 6 Jun 2019 02:52:15 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:38788 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfFFGwP (ORCPT ); Thu, 6 Jun 2019 02:52:15 -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 1hYmFy-0006uS-1E; Thu, 06 Jun 2019 14:52:14 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hYmFx-0006iu-Cw; Thu, 06 Jun 2019 14:52:13 +0800 Date: Thu, 6 Jun 2019 14:52:13 +0800 From: Herbert Xu To: Elena Petrova Cc: linux-crypto@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] crypto: arm64/sha1-ce - correct digest for empty data in finup Message-ID: <20190606065213.t2hd5jbk36i77n4i@gondor.apana.org.au> References: <20190528124152.191773-1-lenaptr@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190528124152.191773-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 01:41:52PM +0100, Elena Petrova wrote: > The sha1-ce finup implementation for ARM64 produces wrong digest > for empty input (len=0). Expected: da39a3ee..., result: 67452301... > (initial value of SHA internal state). The error is in sha1_ce_finup: > for empty data `finalize` will be 1, so the code is relying on > sha1_ce_transform to make the final round. However, in > sha1_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: 07eb54d306f4 ("crypto: arm64/sha1-ce - move SHA-1 ARMv8 implementation to base layer") > Cc: stable@vger.kernel.org > Signed-off-by: Elena Petrova > Reviewed-by: Ard Biesheuvel > --- > arch/arm64/crypto/sha1-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