Skip to content

Commit

Permalink
[sival, keymgr] chip_sw_keymgr_derive_{sealing,attestation}
Browse files Browse the repository at this point in the history
This commit adds the chip_sw_keymgr_derive_{sealing,attestation} tests
covering the complete testplan items, for the comprehensive set of
requirements see `hw/top_earlgrey/data/ip/chip_keymgr_testplan.hjson`.

In a nutshell, the test runs through a complete sealing/attestation
CDI flow that generates identity, software key, sideload OTBN keys in
every operational key manager state and verfies their validity as
specified in the testplan.

Signed-off-by: Andrea Caforio <[email protected]>
Co-authored-by: Tim Trippel <[email protected]>
(cherry picked from commit 9e8dc30)
  • Loading branch information
andrea-caforio committed Nov 5, 2024
1 parent ed9a230 commit 1215f49
Show file tree
Hide file tree
Showing 2 changed files with 488 additions and 0 deletions.
49 changes: 49 additions & 0 deletions sw/device/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,55 @@ opentitan_test(
],
)

opentitan_test(
name = "keymgr_derive_sealing_test",
srcs = ["keymgr_derive_cdi_test.c"],
exec_env = dicts.add(
EARLGREY_TEST_ENVS,
EARLGREY_SILICON_OWNER_ROM_EXT_ENVS,
{
"//hw/top_earlgrey:fpga_cw310_sival": None,
"//hw/top_earlgrey:silicon_creator": None,
},
),
verilator = verilator_params(timeout = "eternal"),
deps = [
"//sw/device/lib/testing:keymgr_testutils",
"//sw/device/lib/testing:otbn_testutils",
"//sw/device/lib/testing:ret_sram_testutils",
"//sw/device/lib/testing:rstmgr_testutils",
"//sw/device/lib/testing:sram_ctrl_testutils",
"//sw/device/lib/testing/test_framework:ottf_main",
"//sw/device/silicon_creator/lib/drivers:retention_sram",
"//sw/otbn/crypto:x25519_sideload",
],
)

opentitan_test(
name = "keymgr_derive_attestation_test",
srcs = ["keymgr_derive_cdi_test.c"],
copts = ["-DDERIVE_ATTESTATION"],
exec_env = dicts.add(
EARLGREY_TEST_ENVS,
EARLGREY_SILICON_OWNER_ROM_EXT_ENVS,
{
"//hw/top_earlgrey:fpga_cw310_sival": None,
"//hw/top_earlgrey:silicon_creator": None,
},
),
verilator = verilator_params(timeout = "eternal"),
deps = [
"//sw/device/lib/testing:keymgr_testutils",
"//sw/device/lib/testing:otbn_testutils",
"//sw/device/lib/testing:ret_sram_testutils",
"//sw/device/lib/testing:rstmgr_testutils",
"//sw/device/lib/testing:sram_ctrl_testutils",
"//sw/device/lib/testing/test_framework:ottf_main",
"//sw/device/silicon_creator/lib/drivers:retention_sram",
"//sw/otbn/crypto:x25519_sideload",
],
)

otp_json(
name = "otp_ctrl_descrambling_otp_json",
partitions = [
Expand Down
Loading

0 comments on commit 1215f49

Please sign in to comment.