Skip to content

Conversation

@ayj
Copy link

@ayj ayj commented Dec 1, 2025

This adds code to test the following scenario:

  1. boot owner FW to sign something with the CDI_1 key,
  2. boot a different owner FW to ensure the key changes and produces a different signature
  3. boot the same owner FW in (1) to ensure the same signature in 1 can be reproduced.

This adds code to test the following scenario:
1. boot owner FW to sign something with the CDI_1 key,
2. boot a different owner FW to ensure the key changes and produces a
   different signature
3. boot the same owner FW in (1) to ensure the same signature in 1 can
   be reproduced.

Signed-off-by: Tim Trippel <[email protected]>
Signed-off-by: Jason Young <[email protected]>
@ayj ayj requested review from a team as code owners December 1, 2025 23:32
@ayj ayj requested review from cfrantz and pamaury and removed request for a team December 1, 2025 23:32
"//sw/device/silicon_creator/lib/drivers:rstmgr",
],
)
for i in range(3)
Copy link
Contributor

@pamaury pamaury Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the binary for i=0 is the same as the binary for i=2 so I would suggest to only create two binaries. If you really want a third create an alias:

alias(name = "cdi1_key_sign_for_assemble_2", actual="cdi1_key_sign_for_assemble_0")

"//hw/top_earlgrey:fpga_cw340_rom_with_fake_keys",
],
)
for i in range(3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here?

test_cmd = """
--bootstrap={firmware}
--second-bootstrap={second}
--third-bootstrap={third}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I think you could just set --third-bootstrap={firmware}

"//hw/top_earlgrey:fpga_cw310_rom_ext",
"//hw/top_earlgrey:fpga_cw340_rom_ext",
],
linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_owner_slot_a",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason to specify the linker script? If none is specified, a default one is used which comes from the exec_env and I think it would be fine for this test.

@pamaury
Copy link
Contributor

pamaury commented Dec 2, 2025

I might be missing something but it seems to me that the test doesn't quite match the specification: each firmware signs a piece of data with the CDI_1 and the CDI_0 and (essentially) checks that the CDI_0 signature doesn't pass with the CDI_1 key. But this doesn't verify that the CDI_1 from the second firmware is different from the first firmware?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants