Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D794FECAAD8 for ; Wed, 31 Aug 2022 03:05:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AF295845F0; Wed, 31 Aug 2022 05:05:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="g0CenD2X"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C970F849A7; Wed, 31 Aug 2022 05:05:50 +0200 (CEST) Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com [IPv6:2607:f8b0:4864:20::c34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 378DB845F0 for ; Wed, 31 Aug 2022 05:05:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oo1-xc34.google.com with SMTP id p48-20020a4a95f3000000b0044b0f5a8d17so2315504ooi.0 for ; Tue, 30 Aug 2022 20:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=U0L1xvL6O81mn3nB+bSKy5oKf8l+i4YiX+Bza8E2Rj8=; b=g0CenD2XvKhUeT5IX2fyI8kI24i3WxBLbrL2xRzsmeX0cyZ89yjljS30fAbqAhgwka 6hHLwbGVrwJq6GAivg/tzfYU8nrA0W1AOdzE+IjIMGk9oLJCcjHfZoBeWsdXRCy0n+l1 gvj6IbNdJdRwTaS8SPg0cJsc02tIQigzyExjU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=U0L1xvL6O81mn3nB+bSKy5oKf8l+i4YiX+Bza8E2Rj8=; b=W/+hGeO/H5V9qZ+PjV46ObepACCE6o1ka46tDcNX0jhUaFE66vxtGwAomc/eoG4ZuY +0LvtXEtoeV2SvGlby+ORQ4rwviLXfUVyvgCC2FtBKqfNMuyH2yKMls3NYrxNQxCZ5LO SVZE1O4WgWNZtGES9wHlVSQarcU/mTl01fY1uFJ2XVEEAu9pynUDFks7VJ+0sIVl2qfM 7OQ+UXZmuY1upbo6GtiChPl1rrexg7+eH/T8OksVqAF0j1c7teS3Utd7Ey+5R59tE9TH MzzfJa95jVsUkz9FpAgTm3vqQvoavlOm9BtVxjkSjgvNslklcKAMcGQ6xxoe0wkQswS3 yQhQ== X-Gm-Message-State: ACgBeo3VPXQGN6FgiZ14AqN86tmdrj8v0qEJ+N3BAOPPaik0W+7FIIw6 D1648U30N+huOjTiuugjuQgyjhweDQPSiQ== X-Google-Smtp-Source: AA6agR65SML8hBSyosiWQCJpC0cHE2dsuFtfrUI5PduWnL6Z7IAiDQ6+kjV36LFIu2fQ1vzykTrkRg== X-Received: by 2002:a4a:9b54:0:b0:425:9532:a772 with SMTP id e20-20020a4a9b54000000b004259532a772mr8233274ook.72.1661915146553; Tue, 30 Aug 2022 20:05:46 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id cp6-20020a056830660600b0063b34c35575sm2888129otb.42.2022.08.30.20.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 20:05:46 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH v5 0/7] tpm: Various minor fixes and enhancements Date: Tue, 30 Aug 2022 21:05:31 -0600 Message-Id: <20220831030538.26742-1-sjg@chromium.org> X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This series contains some minor enhancements for the TPM code to make it work with Chromium OS verified boot. Changes in v5: - Reword mention of measured boot - Use size_t for buffer size Changes in v4: - Rename function and add arguments for the command/subcmd - Rename function and add arguments for the command/subcmd Changes in v3: - Drop limits on the TPM hash size - Update commit message Changes in v2: - Use "cmd" for the digest type in the tpm command - Update comment for tpm_pcr_extend() 'name' parameter - Use constants instead of open-coded values Simon Glass (7): tpm: Require a digest source when extending the PCR tpm: Correct the permissions command in TPMv1 tpm: Correct the define-space command in TPMv2 tpm: sandbox: Allow init of TPM in a different phase tpm: Allow reporting the internal state tpm: Implement state command for Cr50 tpm: Allow committing non-volatile data cmd/tpm-common.c | 20 ++++ cmd/tpm-user-utils.h | 2 + cmd/tpm-v1.c | 3 +- cmd/tpm-v2.c | 3 + cmd/tpm_test.c | 5 +- drivers/tpm/cr50_i2c.c | 163 +++++++++++++++++++++++++++++++++ drivers/tpm/tpm-uclass.c | 10 ++ drivers/tpm/tpm2_tis_sandbox.c | 17 +++- include/tpm-common.h | 20 ++++ include/tpm-v2.h | 30 ++++++ include/tpm_api.h | 8 +- lib/tpm-v1.c | 5 +- lib/tpm-v2.c | 70 ++++++++++++-- lib/tpm_api.c | 10 +- test/dm/Makefile | 1 + test/dm/tpm.c | 34 +++++++ 16 files changed, 380 insertions(+), 21 deletions(-) create mode 100644 test/dm/tpm.c -- 2.37.2.672.g94769d06f0-goog