[PATCH v14 5/8] test: Add sandbox TPM boot measurement

2023-10-24 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass Acked-by: Ilias Apalodimas --- Changes since v5: - Only compile in the measurement u-boot command when CONFIG_MEASURED_BOOT is enabled. arch/sandbox/dts

[PATCH v13 5/8] test: Add sandbox TPM boot measurement

2023-10-19 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass Acked-by: Ilias Apalodimas --- Changes since v5: - Only compile in the measurement u-boot command when CONFIG_MEASURED_BOOT is enabled. arch/sandbox/dts

Re: [PATCH v12 5/8] test: Add sandbox TPM boot measurement

2023-10-19 Thread Ilias Apalodimas
the time the patches were sent -next got merged into -master, so I tried master now to include them into the 2024.01 release. Apologies, if you don't mind please rebase Thanks /Ilias > > > > > > Thanks > > /Ilias > > > > On Thu, 12 Oct 2023 at 16:49, Eddie J

Re: [PATCH v12 5/8] test: Add sandbox TPM boot measurement

2023-10-19 Thread Eddie James
On 10/13/23 12:22, Ilias Apalodimas wrote: Hi Eddie, This doesn't apply on -master, can you please rebase? Ugh I thought you wanted -next... I can rebase again. Thanks /Ilias On Thu, 12 Oct 2023 at 16:49, Eddie James wrote: Use the sandbox TPM driver to measure some boot images

Re: [PATCH v12 5/8] test: Add sandbox TPM boot measurement

2023-10-13 Thread Ilias Apalodimas
Hi Eddie, This doesn't apply on -master, can you please rebase? Thanks /Ilias On Thu, 12 Oct 2023 at 16:49, Eddie James wrote: > > Use the sandbox TPM driver to measure some boot images in a unit > test case. > > Signed-off-by: Eddie James > Reviewed-by: Simon G

[PATCH v12 5/8] test: Add sandbox TPM boot measurement

2023-10-12 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass Acked-by: Ilias Apalodimas --- Changes since v5: - Only compile in the measurement u-boot command when CONFIG_MEASURED_BOOT is enabled. arch/sandbox/dts

[PATCH 7/8] sandbox: tpm: Fix TPM2_CC_NV_DEFINE_SPACE command

2023-09-12 Thread seanedmond
From: Sean Edmond The TPM 2.0 command reference shows "auth" (type TPM2B_AUTH) before "publicInfo" (type TPM2B_NV_PUBLIC). The TPM v2 driver was updated to add this field. The sandbox driver needs to be updated to match the driver implementation. Signed-off-by: Sean Edmond --- drivers/tpm/tp

[PATCH v11 5/8] test: Add sandbox TPM boot measurement

2023-08-07 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass Acked-by: Ilias Apalodimas --- Changes since v5: - Only compile in the measurement u-boot command when CONFIG_MEASURED_BOOT is enabled. arch/sandbox/dts

[PATCH v10 05/10] test: Add sandbox TPM boot measurement

2023-08-07 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass Acked-by: Ilias Apalodimas --- Changes since v5: - Only compile in the measurement u-boot command when CONFIG_MEASURED_BOOT is enabled. arch/sandbox/dts

[PATCH 5/9] test: Add sandbox TPM boot measurement

2023-05-10 Thread Ilias Apalodimas
From: Eddie James Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass Acked-by: Ilias Apalodimas --- arch/sandbox/dts/sandbox.dtsi | 13 +++ arch/sandbox/dts/test.dts | 13 +++ configs/sandbox_defconfig

[PATCH v9 5/6] test: Add sandbox TPM boot measurement

2023-03-08 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass Acked-by: Ilias Apalodimas --- Changes since v5: - Only compile in the measurement u-boot command when CONFIG_MEASURED_BOOT is enabled. arch/sandbox/dts

[PATCH v8 5/6] test: Add sandbox TPM boot measurement

2023-03-03 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass Acked-by: Ilias Apalodimas --- Changes since v5: - Only compile in the measurement u-boot command when CONFIG_MEASURED_BOOT is enabled arch/sandbox/dts

[PATCH v7 5/6] test: Add sandbox TPM boot measurement

2023-03-01 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass Acked-by: Ilias Apalodimas --- Changes since v5: - Only compile in the measurement u-boot command when CONFIG_MEASURED_BOOT is enabled arch/sandbox/dts

Re: [PATCH v6 5/6] test: Add sandbox TPM boot measurement

2023-02-23 Thread Ilias Apalodimas
On Wed, 22 Feb 2023 at 20:02, Eddie James wrote: > > Use the sandbox TPM driver to measure some boot images in a unit > test case. > > Signed-off-by: Eddie James > Reviewed-by: Simon Glass > --- > Changes since v5: > - Only compile in the measurement u-boot comman

[PATCH v6 5/6] test: Add sandbox TPM boot measurement

2023-02-22 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass --- Changes since v5: - Only compile in the measurement u-boot command when CONFIG_MEASURED_BOOT is enabled arch/sandbox/dts/sandbox.dtsi | 13 +++ arch

[PATCH v5 5/6] test: Add sandbox TPM boot measurement

2023-02-02 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James Reviewed-by: Simon Glass --- Changes since v4: - Drop u8 casting in measurement test Changes since v2: - Changed reserved memory address to the top of the RAM for sandbox dts. arch

Re: [PATCH v4 5/6] test: Add sandbox TPM boot measurement

2023-01-25 Thread Simon Glass
Hi Eddie, On Wed, 25 Jan 2023 at 10:18, Eddie James wrote: > > Use the sandbox TPM driver to measure some boot images in a unit > test case. > > Signed-off-by: Eddie James > --- > arch/sandbox/dts/sandbox.dtsi | 14 > arch/sandbox/dts/test.dts

[PATCH v4 5/6] test: Add sandbox TPM boot measurement

2023-01-25 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James --- arch/sandbox/dts/sandbox.dtsi | 14 arch/sandbox/dts/test.dts | 13 +++ configs/sandbox_defconfig | 1 + include/test/suites.h | 1 + test/boot/Makefile

[PATCH v3 5/6] test: Add sandbox TPM boot measurement

2023-01-12 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James --- arch/sandbox/dts/sandbox.dtsi | 14 arch/sandbox/dts/test.dts | 13 +++ configs/sandbox_defconfig | 1 + include/test/suites.h | 1 + test/boot/Makefile

Re: [PATCH v2 5/5] test: Add sandbox TPM boot measurement

2023-01-11 Thread Eddie James
On 1/10/23 16:37, Heinrich Schuchardt wrote: On 1/10/23 23:32, Heinrich Schuchardt wrote: On 1/9/23 22:55, Eddie James wrote: Use the sandbox TPM driver to measure some boot images in a unit test case. $ ./u-boot -T -c "ut measurement" Running 1 measurement tests Tes

Re: [PATCH v2 5/5] test: Add sandbox TPM boot measurement

2023-01-10 Thread Heinrich Schuchardt
On 1/10/23 23:32, Heinrich Schuchardt wrote: On 1/9/23 22:55, Eddie James wrote: Use the sandbox TPM driver to measure some boot images in a unit test case. $ ./u-boot -T -c "ut measurement" Running 1 measurement tests Test: measure: measurement.c Failures: 0 Signed-off-by: E

Re: [PATCH v2 5/5] test: Add sandbox TPM boot measurement

2023-01-10 Thread Heinrich Schuchardt
On 1/9/23 22:55, Eddie James wrote: Use the sandbox TPM driver to measure some boot images in a unit test case. $ ./u-boot -T -c "ut measurement" Running 1 measurement tests Test: measure: measurement.c Failures: 0 Signed-off-by: Eddie James --- arch/sandbox/dts/tes

Re: [PATCH v2 5/5] test: Add sandbox TPM boot measurement

2023-01-10 Thread Eddie James
On 1/10/23 16:02, Heinrich Schuchardt wrote: On 1/10/23 17:38, Eddie James wrote: On 1/9/23 17:26, Heinrich Schuchardt wrote: On 1/10/23 00:13, Heinrich Schuchardt wrote: On 1/9/23 22:55, Eddie James wrote: Use the sandbox TPM driver to measure some boot images in a unit test case. $ ./u

Re: [PATCH v2 5/5] test: Add sandbox TPM boot measurement

2023-01-10 Thread Heinrich Schuchardt
On 1/10/23 17:38, Eddie James wrote: On 1/9/23 17:26, Heinrich Schuchardt wrote: On 1/10/23 00:13, Heinrich Schuchardt wrote: On 1/9/23 22:55, Eddie James wrote: Use the sandbox TPM driver to measure some boot images in a unit test case. $ ./u-boot -T -c "ut measurement"

Re: [PATCH v2 5/5] test: Add sandbox TPM boot measurement

2023-01-10 Thread Eddie James
On 1/9/23 17:26, Heinrich Schuchardt wrote: On 1/10/23 00:13, Heinrich Schuchardt wrote: On 1/9/23 22:55, Eddie James wrote: Use the sandbox TPM driver to measure some boot images in a unit test case. $ ./u-boot -T -c "ut measurement" Running 1 measurement tests Test: measure: mea

Re: [PATCH v2 5/5] test: Add sandbox TPM boot measurement

2023-01-09 Thread Heinrich Schuchardt
On 1/10/23 00:13, Heinrich Schuchardt wrote: On 1/9/23 22:55, Eddie James wrote: Use the sandbox TPM driver to measure some boot images in a unit test case. $ ./u-boot -T -c "ut measurement" Running 1 measurement tests Test: measure: measurement.c Failures: 0 Signed-off-by: E

Re: [PATCH v2 5/5] test: Add sandbox TPM boot measurement

2023-01-09 Thread Heinrich Schuchardt
On 1/9/23 22:55, Eddie James wrote: Use the sandbox TPM driver to measure some boot images in a unit test case. $ ./u-boot -T -c "ut measurement" Running 1 measurement tests Test: measure: measurement.c Failures: 0 Signed-off-by: Eddie James --- arch/sandbox/dts/tes

[PATCH v2 5/5] test: Add sandbox TPM boot measurement

2023-01-09 Thread Eddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. $ ./u-boot -T -c "ut measurement" Running 1 measurement tests Test: measure: measurement.c Failures: 0 Signed-off-by: Eddie James --- arch/sandbox/dts/test.dts | 12 +++ configs/sandbox_defconfig | 1

Re: sandbox TPM

2021-09-02 Thread Simon Glass
; > "dfu_alt_info" env variable not defined! > Probably dfu_alt_info not defined > "dfu_alt_info" env variable not defined! > Probably dfu_alt_info not defined > Booting /EFI\grub\shimriscv64.efi > PE image measurement failed <<<<<<<<<

Re: sandbox TPM

2021-08-30 Thread Heinrich Schuchardt
as bugs? If it is incomplete, what is needed by U-Boot? A TPM emulation as UNIX socket exists with https://github.com/stefanberger/swtpm.git. QEMU already uses this emulator. Couldn't the sandbox do the same? I think this is the fastest way to get a compliant sandbox TPM. Well we could

Re: sandbox TPM

2021-08-29 Thread Ilias Apalodimas
s://github.com/stefanberger/swtpm.git. QEMU already uses this > > > emulator. > > > > > > Couldn't the sandbox do the same? I think this is the fastest way to get > > > a compliant sandbox TPM. > > > > Well we could if we need it. Are you sure it

Re: sandbox TPM

2021-08-29 Thread Peter Robinson
mplete or that it has bugs? If it is incomplete, > what is needed by U-Boot? > > > > > A TPM emulation as UNIX socket exists with > > https://github.com/stefanberger/swtpm.git. QEMU already uses this emulator. > > > > Couldn't the sandbox do the same? I think this i

Re: sandbox TPM

2021-08-28 Thread Simon Glass
as UNIX socket exists with > https://github.com/stefanberger/swtpm.git. QEMU already uses this emulator. > > Couldn't the sandbox do the same? I think this is the fastest way to get > a compliant sandbox TPM. Well we could if we need it. Are you sure it is a good idea? There

sandbox TPM

2021-08-28 Thread Heinrich Schuchardt
liant sandbox TPM. Best regards Heinrich

Re: [PATCH v2 04/10] sandbox: tpm: Correct handling of get-capability

2021-07-24 Thread Simon Glass
This function current handles the kernel case incorrectly. Fix it, and use the shorter TPM_HDR_LEN while we are here. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm_tis_sandbox.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) Applied to u-boot-dm,

Re: [PATCH v2 02/10] sandbox: tpm: Tidy up reading and writing of device state

2021-07-24 Thread Simon Glass
At present this code assumes that the TPM data has been read but this may not be the case. Refactor the code to use a separate pointer so we know the current state of the data. Add error checking for the data size. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm_tis_sandb

Re: [PATCH v2 06/10] sandbox: tpm: Track whether the state is valid

2021-07-24 Thread Simon Glass
Add checking as to whether the current TPM state is valid, so we can implement reading/writing the state. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm2_tis_sandbox.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) Applied to u-boot-dm, thanks!

Re: [PATCH v2 01/10] sandbox: tpm: Split out common nvdata code

2021-07-24 Thread Simon Glass
We want to support nvdata in TPM2 as well. To avoid code duplicating the associated code, move it into a common file. Drop the special-case logic for the kernel space. This can be handled by the higher-level code now, i.e. in vboot itself. Signed-off-by: Simon Glass --- (no changes since v1)

Re: [PATCH v2 08/10] sandbox: tpm: Support storing device state in tpm2

2021-07-24 Thread Simon Glass
At present the tpm2 emulator does not support storing the device state. Add this so we can handle the normal vboot flow through the sandbox executables (VPL->SPL etc.) with the TPM contents staying in place. Note: sandbox has not yet been converted to use livetree for the state information, since

Re: [PATCH v2 03/10] sandbox: tpm: Support the define-space command

2021-07-24 Thread Simon Glass
Add support for this command, moving away from the previous approach of hard-coding the initial data in the driver, now that the kernel-space data has to be set up by the higher-level vboot code. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/sandbox_common.c | 11 ++

Re: [PATCH v2 07/10] sandbox: tpm: Support nvdata in TPM2

2021-07-24 Thread Simon Glass
Add support for this feature in the TPM2 emulator, to support Chromium OS vboot. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm2_tis_sandbox.c | 68 ++ include/tpm-v2.h | 2 + 2 files changed, 70 insertions(+) Applied to u-b

Re: [PATCH v2 05/10] sandbox: tpm: Finish comments for struct sandbox_tpm2

2021-07-24 Thread Simon Glass
Tidy up the missing comments for this struct. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm2_tis_sandbox.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) Applied to u-boot-dm, thanks!

Re: [PATCH v2 10/10] sandbox: tpm: Support extending a PCR multiple times

2021-07-24 Thread Simon Glass
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: Simo

Re: [PATCH v2 09/10] sandbox: tpm: Correct handling of SANDBOX_TPM_PCR_NB

2021-07-24 Thread Simon Glass
This is the number of PCRs, so the current check is off by one. Also the map itself should not be checked, just the resulting pcr_index, to avoid confusing people who read the code. Fix these problems. Signed-off-by: Simon Glass --- Changes in v2: - Add new patch to correct handling of SANDBOX_

Re: [PATCH 9/9] sandbox: tpm: Support extending a PCR multiple times

2021-07-20 Thread Simon Glass
Hi Ilias, On Thu, 15 Jul 2021 at 13:21, Ilias Apalodimas wrote: > > On Thu, 15 Jul 2021 at 22:04, Ilias Apalodimas > wrote: > > > > On Mon, Jul 05, 2021 at 09:48:49AM -0600, Simon Glass wrote: > > > It is fairly easy to handle this case and it makes the emulator more > > > useful, since PCRs are

[PATCH v2 10/10] sandbox: tpm: Support extending a PCR multiple times

2021-07-18 Thread Simon Glass
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: Simo

[PATCH v2 09/10] sandbox: tpm: Correct handling of SANDBOX_TPM_PCR_NB

2021-07-18 Thread Simon Glass
DBOX_TPM_PCR_NB) { - printf("Sandbox TPM handles up to %d PCR(s)\n", - SANDBOX_TPM_PCR_NB); - rc = TPM2_RC_VALUE; - return sandbox_tpm2_fill_buf(recv, recv_len, tag, rc); - } - if (!pcr_map) { -

[PATCH v2 08/10] sandbox: tpm: Support storing device state in tpm2

2021-07-18 Thread Simon Glass
At present the tpm2 emulator does not support storing the device state. Add this so we can handle the normal vboot flow through the sandbox executables (VPL->SPL etc.) with the TPM contents staying in place. Note: sandbox has not yet been converted to use livetree for the state information, since

[PATCH v2 07/10] sandbox: tpm: Support nvdata in TPM2

2021-07-18 Thread Simon Glass
Add support for this feature in the TPM2 emulator, to support Chromium OS vboot. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm2_tis_sandbox.c | 68 ++ include/tpm-v2.h | 2 + 2 files changed, 70 insertions(+) diff --git a/d

[PATCH v2 06/10] sandbox: tpm: Track whether the state is valid

2021-07-18 Thread Simon Glass
Add checking as to whether the current TPM state is valid, so we can implement reading/writing the state. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm2_tis_sandbox.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/tpm/tpm2_tis_sand

[PATCH v2 05/10] sandbox: tpm: Finish comments for struct sandbox_tpm2

2021-07-18 Thread Simon Glass
Tidy up the missing comments for this struct. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm2_tis_sandbox.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm2_tis_sandbox.c index 24c8

[PATCH v2 04/10] sandbox: tpm: Correct handling of get-capability

2021-07-18 Thread Simon Glass
This function current handles the kernel case incorrectly. Fix it, and use the shorter TPM_HDR_LEN while we are here. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm_tis_sandbox.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/t

[PATCH v2 02/10] sandbox: tpm: Tidy up reading and writing of device state

2021-07-18 Thread Simon Glass
At present this code assumes that the TPM data has been read but this may not be the case. Refactor the code to use a separate pointer so we know the current state of the data. Add error checking for the data size. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm_tis_sandb

[PATCH v2 03/10] sandbox: tpm: Support the define-space command

2021-07-18 Thread Simon Glass
Add support for this command, moving away from the previous approach of hard-coding the initial data in the driver, now that the kernel-space data has to be set up by the higher-level vboot code. Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/sandbox_common.c | 11 ++

[PATCH v2 01/10] sandbox: tpm: Split out common nvdata code

2021-07-18 Thread Simon Glass
space */ -#define NV_DATA_SIZE 0x20 - -struct nvdata_state { - bool present; - u8 data[NV_DATA_SIZE]; -}; - /* * Information about our TPM emulation. This is preserved in the sandbox * state file if enabled. @@ -140,27 +89,6 @@ static int sandbox_tpm_write_state(void *blob, int no

Re: [PATCH 9/9] sandbox: tpm: Support extending a PCR multiple times

2021-07-15 Thread Ilias Apalodimas
On Thu, 15 Jul 2021 at 22:04, Ilias Apalodimas wrote: > > On Mon, Jul 05, 2021 at 09:48:49AM -0600, Simon Glass wrote: > > 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 s

Re: [PATCH 9/9] sandbox: tpm: Support extending a PCR multiple times

2021-07-15 Thread Ilias Apalodimas
On Mon, Jul 05, 2021 at 09:48:49AM -0600, Simon Glass wrote: > 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. > > Signed-off-by: Simon Glass > --- > > driver

Re: [PATCH 5/9] sandbox: tpm: Finish comments for struct sandbox_tpm2

2021-07-15 Thread Ilias Apalodimas
On Mon, Jul 05, 2021 at 09:48:45AM -0600, Simon Glass wrote: > Tidy up the missing comments for this struct. > > Signed-off-by: Simon Glass > --- > > drivers/tpm/tpm2_tis_sandbox.c | 20 > 1 file changed, 16 insertions(+), 4 deletions(-) > > diff --git a/drivers/tpm/tpm2_t

Re: [PATCH 4/9] sandbox: tpm: Correct handling of get-capability

2021-07-15 Thread Ilias Apalodimas
Hi Simon, On Mon, Jul 05, 2021 at 09:48:44AM -0600, Simon Glass wrote: > This function current handles the kernel case incorrectly. Fix it, and > use the shorter TPM_HDR_LEN while we are here. > > Signed-off-by: Simon Glass > --- > > drivers/tpm/tpm_tis_sandbox.c | 14 -- > 1 file

[PATCH 8/9] sandbox: tpm: Support storing device state in tpm2

2021-07-05 Thread Simon Glass
At present the tpm2 emulator does not support storing the device state. Add this so we can handle the normal vboot flow through the sandbox executables (VPL->SPL etc.) with the TPM contents staying in place. Note: sandbox has not yet been converted to use livetree for the state information, since

[PATCH 7/9] sandbox: tpm: Support nvdata in TPM2

2021-07-05 Thread Simon Glass
Add support for this feature in the TPM2 emulator, to support Chromium OS vboot. Signed-off-by: Simon Glass --- drivers/tpm/tpm2_tis_sandbox.c | 68 ++ include/tpm-v2.h | 2 + 2 files changed, 70 insertions(+) diff --git a/drivers/tpm/tpm2_tis_san

[PATCH 9/9] sandbox: tpm: Support extending a PCR multiple times

2021-07-05 Thread Simon Glass
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. Signed-off-by: Simon Glass --- drivers/tpm/tpm2_tis_sandbox.c | 19 --- 1 file changed, 12 insertion

[PATCH 6/9] sandbox: tpm: Track whether the state is valid

2021-07-05 Thread Simon Glass
Add checking as to whether the current TPM state is valid, so we can implement reading/writing the state. Signed-off-by: Simon Glass --- drivers/tpm/tpm2_tis_sandbox.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm

[PATCH 4/9] sandbox: tpm: Correct handling of get-capability

2021-07-05 Thread Simon Glass
This function current handles the kernel case incorrectly. Fix it, and use the shorter TPM_HDR_LEN while we are here. Signed-off-by: Simon Glass --- drivers/tpm/tpm_tis_sandbox.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/tpm/tpm_tis_sandbox.c b/

[PATCH 5/9] sandbox: tpm: Finish comments for struct sandbox_tpm2

2021-07-05 Thread Simon Glass
Tidy up the missing comments for this struct. Signed-off-by: Simon Glass --- drivers/tpm/tpm2_tis_sandbox.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm2_tis_sandbox.c index 24c804a5645..5e0bd304699 10

[PATCH 2/9] sandbox: tpm: Tidy up reading and writing of device state

2021-07-05 Thread Simon Glass
At present this code assumes that the TPM data has been read but this may not be the case. Refactor the code to use a separate pointer so we know the current state of the data. Add error checking for the data size. Signed-off-by: Simon Glass --- drivers/tpm/tpm_tis_sandbox.c | 35 +

[PATCH 3/9] sandbox: tpm: Support the define-space command

2021-07-05 Thread Simon Glass
Add support for this command, moving away from the previous approach of hard-coding the initial data in the driver, now that the kernel-space data has to be set up by the higher-level vboot code. Signed-off-by: Simon Glass --- drivers/tpm/sandbox_common.c | 11 +++ drivers/tpm/sandbox_

[PATCH 1/9] sandbox: tpm: Split out common nvdata code

2021-07-05 Thread Simon Glass
x20 - -struct nvdata_state { - bool present; - u8 data[NV_DATA_SIZE]; -}; - /* * Information about our TPM emulation. This is preserved in the sandbox * state file if enabled. @@ -140,27 +89,6 @@ static int sandbox_tpm_write_state(void *blob, int node) SANDBOX_STATE_IO(sandbox

Re: [U-Boot] [PATCH 06/25] sandbox: tpm: Allow debugging of data packages

2018-11-22 Thread sjg
This is not normally useful, so change the code to avoid writing out every data package. This can be enabled with #define DEBUG. Signed-off-by: Simon Glass --- drivers/tpm/tpm_tis_sandbox.c | 6 ++ 1 file changed, 6 insertions(+) Applied to u-boot-dm/master, thanks! ___

[U-Boot] [PATCH 06/25] sandbox: tpm: Allow debugging of data packages

2018-11-06 Thread Simon Glass
This is not normally useful, so change the code to avoid writing out every data package. This can be enabled with #define DEBUG. Signed-off-by: Simon Glass --- drivers/tpm/tpm_tis_sandbox.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/tpm/tpm_tis_sandbox.c b/drivers/tpm/tpm

Re: [U-Boot] [PATCH 13/15] sandbox: tpm: Enhance to support the latest Chromium OS

2018-10-09 Thread sjg
This driver was originally written against Chromium OS circa 2012. A few new features have been added. Enhance the TPM driver to match. This mostly includes a few new messages and properly modelling whether a particular 'space' is present or not. Signed-off-by: Simon Glass --- drivers/tpm/tpm_t

Re: [U-Boot] [PATCH 12/15] sandbox: tpm: Tidy up enums and return values

2018-10-09 Thread sjg
Use an enum for command values instead of open-coding them. This removes the need for comments. Also make sure the driver returns proper error numbers instead of -1. Signed-off-by: Simon Glass --- drivers/tpm/tpm_tis_sandbox.c | 20 ++-- include/tpm-v1.h | 14 ++

[U-Boot] [PATCH 13/15] sandbox: tpm: Enhance to support the latest Chromium OS

2018-10-01 Thread Simon Glass
This driver was originally written against Chromium OS circa 2012. A few new features have been added. Enhance the TPM driver to match. This mostly includes a few new messages and properly modelling whether a particular 'space' is present or not. Signed-off-by: Simon Glass --- drivers/tpm/tpm_t

[U-Boot] [PATCH 12/15] sandbox: tpm: Tidy up enums and return values

2018-10-01 Thread Simon Glass
Use an enum for command values instead of open-coding them. This removes the need for comments. Also make sure the driver returns proper error numbers instead of -1. Signed-off-by: Simon Glass --- drivers/tpm/tpm_tis_sandbox.c | 20 ++-- include/tpm-v1.h | 14 ++

[U-Boot] [PATCH 22/32] sandbox: tpm: Fix nvwrite command

2013-11-10 Thread Simon Glass
From: Che-Liang Chiou The original codes misused recvbuf in source buffer instead of sendbuf, and read from incorrect offset 14 instead of 22. Signed-off-by: Che-Liang Chiou Signed-off-by: Simon Glass Reviewed-by: Simon Glass Tested-by: Che-Liang Chiou --- drivers/tpm/tpm_tis_sandbox.c | 4

[U-Boot] [PATCH 19/32] sandbox: tpm: Add TPM emulation

2013-11-10 Thread Simon Glass
dt_setprop(blob, node, prop_name, state.nvdata[i], + NV_DATA_SIZE); + } + + return 0; +} + +SANDBOX_STATE_IO(sandbox_tpm, "google,sandbox-tpm", sandbox_tpm_read_state, +sandbox_tpm_write_state); + +static int index_to_seq(uint32_t index) +{ + switch (index