From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30378C4338F for ; Sat, 24 Jul 2021 21:12:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6D61460E92 for ; Sat, 24 Jul 2021 21:12:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6D61460E92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6A96E831FD; Sat, 24 Jul 2021 23:12:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="lYufqdFw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB388831BD; Sat, 24 Jul 2021 23:12:08 +0200 (CEST) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 85B52831BA for ; Sat, 24 Jul 2021 23:11:59 +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@google.com Received: by mail-wm1-x334.google.com with SMTP id 9-20020a05600c26c9b02901e44e9caa2aso3769302wmv.4 for ; Sat, 24 Jul 2021 14:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:from:in-reply-to:references:date:message-id :subject:to:cc; bh=0jdPxEVnMOkJbARsOX6JzD5c8hB6BXxDsS6Fd8M3S6s=; b=lYufqdFwEH7f54j3xtbVZybSouGBX95BMskHi+o7lBtKZnkf6gFbVHTOGd+ZLZL/Jd B3bo9pCkgN/xm+7TrM9mru0mS9LH69fLuSKxFfvk59DghXI6pqqal3An4njJbPQLNNaw SdZimmzCBfBcrvgwLyDx2yDUU+OpRt70kTJF8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:in-reply-to:references :date:message-id:subject:to:cc; bh=0jdPxEVnMOkJbARsOX6JzD5c8hB6BXxDsS6Fd8M3S6s=; b=dD+Z8vxeXrByaoiHrc4Y36dr70JVSrC/tcjgoRzmJd1SMtp5nKJ/vTLiwvb4cIOlYX kW+S1YvN4XRfPAimy/Mn6ml8neX9lhgndLzHUuGOJO6aTuqHPGbpe0KFlorFnwlIJ9dy 1Vr1nOBGvNEv1iVACsPMl/wUNWfLSCsSgkSGPd8XB2uf4PIeYO8xWAJbq6PnWmGdBrqO zcA/brnmEyeIljnWx6N3n4bhN+ycK8yA+F8JeHqr1FmmVVqKF7r2GEyLzXflEduMd61a 7ejo8BAmETT6IkVaipqpoWSBzgVlbte4mASIdf9tTe+mUyGmmBxInLrN68fKtXWpHVVW 0u/Q== X-Gm-Message-State: AOAM53050CaAKzwm1dxu8FYekLeGFv7Lr5k2SHQtLpCKJlDI8OgKHaU1 /m3l8C7iPZYbYC87csLO5zvifxIXtXMJMEGA2FZnxg== X-Google-Smtp-Source: ABdhPJxjJqBMOFM4trYcruqOoYdcrbmUJ3tVk/wv8ySvPF8WQdhTXhWEHUQrZO8RDoalfkIizNIsH0tEFhVXuRd4Bmo= X-Received: by 2002:a1c:790e:: with SMTP id l14mr19196439wme.119.1627161118652; Sat, 24 Jul 2021 14:11:58 -0700 (PDT) Received: from 480794996271 named unknown by gmailapi.google.com with HTTPREST; Sat, 24 Jul 2021 14:11:57 -0700 MIME-Version: 1.0 From: Simon Glass In-Reply-To: <20210718201806.761202-11-sjg@chromium.org> References: <20210718201806.761202-11-sjg@chromium.org> <20210718201806.761202-1-sjg@chromium.org> Date: Sat, 24 Jul 2021 14:11:57 -0700 X-Google-Sender-Auth: TksbDIXy3JDVfqlqiu1qpZfDBHo Message-ID: Subject: Re: [PATCH v2 10/10] sandbox: tpm: Support extending a PCR multiple times To: Simon Glass Cc: Ilias Apalodimas , Thirupathaiah Annapureddy , Heinrich Schuchardt , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean It is fairly easy to handle this case and it makes the emulator more useful, since PCRs are commonly extended several times. Add support for this, using U-Boot's sha256 support. For now sandbox only supports a single PCR, but that is enough for the tests that currently exist. Signed-off-by: Simon Glass --- Changes in v2: - Drop the constant sandbox_extended_once_pcr since we can calculate it - Update the commit message to explain that there is only one PCR drivers/tpm/tpm2_tis_sandbox.c | 24 ++++++++++-------------- test/py/tests/test_tpm2.py | 18 +++++++++++++++++- 2 files changed, 27 insertions(+), 15 deletions(-) Applied to u-boot-dm, thanks!