Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7963947rwr; Wed, 10 May 2023 15:38:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4YzH0DxWtnVD3kjAiOJto5ZSDx2ZMQDIuuQNcbKPxCKvVN8i3mmPrss8EzRSTkMUZzJir5 X-Received: by 2002:a05:6a20:ce43:b0:f0:718f:8eee with SMTP id id3-20020a056a20ce4300b000f0718f8eeemr20284194pzb.59.1683758304670; Wed, 10 May 2023 15:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683758304; cv=none; d=google.com; s=arc-20160816; b=gn74sSfCUGT8Qp80xdtD+jNdqr1CSfvmXdCBU3qTEOBzaYqqbkU0rTcpFUXbrBr01Z UWldRCy1bmr5VSK2i096ZxejfAbSBbEe9dZ2VEiDxEvd+2YdVsxwgvRgxC4fZiT79EUb LdGsavsA91YecPIRI/gyXjpLiWc4fYB+jFPXgYXDerBMsfCYLNVoLGvTuZYkRS6hM7bN GecHzAlkjNf7+S+RqlgQX/f92zkOYwjssZcmLxFdK1XGVdfdhpVJ8yM6YW0xcHt2HBoD 6xwXFLMZjRUZc2p95N08UmLbc1SrinzURRMkjM3M2kQYMmUW45v8sSAaCsORQXYH2edx qDSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:to:from:subject:cc :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=V2awygsn4ZLqsulzhTduUcCELjkjZTVQ60NG5eFw79Y=; b=XBI2XgxXbZCaFOAjTxD+XGJ8qgHMuQbkBK0zZKilLt92M+6E6DLOfccuhgBAYs5r/4 14IMU/6NeXWGblIvT8/K9O4HyjDAfR+2YSCaOUYoMvfG8i6PE9MKT5437YVi/16leFcp 7H+k/V34d7sbTuMichd2FrfuChOyrpQocBcqO0ArplXdc/I1KsY9VKVVZ253TE11+V8m vRmhtbhI7LMyK0bwjxiuqYRWvmNB4NOKV0hQT0I7POpKCGDTml7MI9ZW8o6KtyQh+cIS 9+AaKpeAhHhMawTdEDc9wePAwjPfWkzlPYXBaLlxp/8refUMz+ciA/5sl8ekn8zJVj8p wVtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MQrjtZE7; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u129-20020a627987000000b0064580409a12si6018456pfc.320.2023.05.10.15.37.38; Wed, 10 May 2023 15:38:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MQrjtZE7; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236116AbjEJW2n (ORCPT + 99 others); Wed, 10 May 2023 18:28:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232452AbjEJW2m (ORCPT ); Wed, 10 May 2023 18:28:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9BB7270D; Wed, 10 May 2023 15:28:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 44F0C630E2; Wed, 10 May 2023 22:28:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5981C433D2; Wed, 10 May 2023 22:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683757719; bh=1W4Tchoh84C5QWw5XU02NZ4Hk4wBRIADDe2kWbFhDbg=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=MQrjtZE7rCyCxkaAjSFd9e5OPXIDJEZf7inGknMgUfolDQrdak7030W6sVj5Y+jvh nPs/M8QHCh9gftNAXVp8cbWVnTADGxNjM/qWFGfQLuX2l9ZRJCGcYCocyyS4X5BD1a enq0ve6NoQ41pHnmbnj6UWom4F7KY73uvhyriHRj/PGVQAl3D72FwRg7kBmj05J2+G bYzK7oiMwvRtx3IzUpmwvyum0I8f30YOVAqVifHUixcVQj/yDZjnBH7v/QlJmf3MIb F+2QBE5p/KMfgZOML7a9i627jSqnm9E1FHpLjDBUZ8pxrnKRdT1uad9C0RWk0QehBe VjDvU+SMF1sfw== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 11 May 2023 01:28:33 +0300 Message-Id: Cc: , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v6 06/14] x86: Add early SHA support for Secure Launch early measurements From: "Jarkko Sakkinen" To: "Eric Biggers" , "Ross Philipson" X-Mailer: aerc 0.14.0 References: <20230504145023.835096-1-ross.philipson@oracle.com> <20230504145023.835096-7-ross.philipson@oracle.com> <20230510012144.GA1851@quark.localdomain> In-Reply-To: <20230510012144.GA1851@quark.localdomain> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed May 10, 2023 at 4:21 AM EEST, Eric Biggers wrote: > On Thu, May 04, 2023 at 02:50:15PM +0000, Ross Philipson wrote: > > From: "Daniel P. Smith" > >=20 > > The SHA algorithms are necessary to measure configuration information i= nto > > the TPM as early as possible before using the values. This implementati= on > > uses the established approach of #including the SHA libraries directly = in > > the code since the compressed kernel is not uncompressed at this point. > >=20 > > The SHA code here has its origins in the code from the main kernel: > >=20 > > commit c4d5b9ffa31f ("crypto: sha1 - implement base layer for SHA-1") > >=20 > > That code could not be pulled directly into the setup portion of the > > compressed kernel because of other dependencies it pulls in. The result > > is this is a modified copy of that code that still leverages the core > > SHA algorithms. > >=20 > > Signed-off-by: Daniel P. Smith > > Signed-off-by: Ross Philipson > > SHA-1 is insecure. Why are you still using SHA-1? Don't TPMs support SH= A-2 > now? > > And if you absolutely MUST use SHA-1 despite it being insecure, please at= least > don't obfuscate it by calling it simply "SHA". AFAIK the TCG specs require for any TPM2 implementation to support both SHA-1 and SHA-256, so this as a new feature should lock in to the latter. BR, Jarkko