[keymgr_dpe] Replace keymgr in EG - PR9 top level integration - #30697
[keymgr_dpe] Replace keymgr in EG - PR9 top level integration#30697rroth-lowrisc wants to merge 64 commits into
Conversation
e5af58b to
a4efea8
Compare
andreaskurth
left a comment
There was a problem hiding this comment.
Many thanks @rroth-lowrisc for this work!
I agree with the RTL changes:
keymgr_dpeis instantiated in place ofkeymgrintop_earlgreywith every port correctly wired.- The seed source selector for
keymgr_dpeis set so that it's behaviorally equivalent to the priorkeymgrinstance.
The DV changes seem consistent as well (sequences and testplan renamed/added correctly).
I've added a couple small comments on RTL/generation and DV/testplan.
The main unresolved area in this PR I see in SW (I appreciate this PR depends on other PRs where SW changes are work in progress, but I don't expect those PRs to resolve top-level SW issues). Shall we take some time today to discuss this?
8151133 to
504036c
Compare
504036c to
513b9b0
Compare
513b9b0 to
23068f6
Compare
Replace all occurrences of `keymgr` with their respective counterpart from `keymgr_dpe`. Due to timeout errors the verilator timeout was set to "long". Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Replace all occurrences of `keymgr` with their respective counterpart from `keymgr_dpe`. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Replace all occurrences of `keymgr` with their respective counterpart from `keymgr_dpe`. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Signed-off-by: Raphael Roth <rroth@lowrisc.org>
…ents` Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Replace all occurrences of `keymgr` with their respective counterpart from `keymgr_dpe`. The sealing key is now derived from DPE slot 0, which has to stay in sync with the slot used in `dice_chain.c`. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
…value` Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Replace all occurrences of the `keymgr` with the newly introduced `keymgr_dpe`. Because the `keymgr_dpe` derives the CreatorRootKey in the ROM rather than in the immutable ROM_EXT, the DICE chain construction had to be restructured: the ROM now advances the DPE slots and the ROM_EXT consumes them. This split was approved by the DPE RFC: https://docs.google.com/document/d/1iF0EWyJkSEtRL9d057imLo4s6DWNrZ6Mpt0QKD8OMMc Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Compared to the original `keymgr`, the `keymgr_dpe` derives the _CreatorRootKey_ already in the ROM. Therefore it is impossible to reconstruct the binding values used for the key derivations. This test only generates two SW readable keys and compares them, expecting a mismatch / match depending on the OTP configuration. The OTP SECRET2 images must be locked, otherwise `keymgr_dpe` will transition into the invalid state when deriving the CREATOR_ROOT_KEY. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Signed-off-by: Raphael Roth <rroth@lowrisc.org>
The new _rom_ supporting the `keymgr_dpe` introduces several new `sec_mmio_check_values`. The overall expected number in the `rom_e2e_static_critical_test.c` must be updated too. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Replace `keymgr` with `keymgr_dpe` in the shutdown path: `HAS_KEYMGR` becomes `HAS_KEYMGR_DPE`. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Switch the TPM key descriptors and the EK diversifier to their `keymgr_dpe` types and drop the `.type` field. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
…etup Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Drop the `sc_keymgr_key_type_t` argument from `otbn_boot_attestation_keygen` and `otbn_boot_attestation_key_save`. The `keymgr_dpe` encodes the sealing / attestation key in the DPE slot selected by the diversifier instead of a separate key type. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Replace the `keymgr` testutils with their `keymgr_dpe` equivalents across the SCA penetration-test firmware Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Replace the `keymgr` testutils with their `keymgr_dpe` equivalents across the FI penetration-test firmware Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Signed-off-by: Raphael Roth <rroth@lowrisc.org>
…ls functions Disable `entropy_src_edn_reqs_test` / `kmac_error_conditions_test` / `kmac_kmac_key_sideload_test` for `darjeeling`. Tracked in lowRISC#30919. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
`keymgr_dpe` now consumes the `creator_root_key` (UDS) directly in the
ROM during boot. Any test that boots through the ROM will fail with
`kErrorKeymgrInternal` if `secret2` isn't locked, since OTP reports the
root key shares as invalid and `keymgr_dpe` flags the load as invalid.
Locking `secret2` computes its digest, which asserts `secrets_valid` and
marks the device as personalized, something the life cycle controller
rejects in RAW and all TEST_* states.
`EARLGREY_STD_OTP_OVERLAYS` uses the new `otp_json_secret2_lock_by_lc_state`
overlay, which provisions the SECRET2 items only, while
`otp_json_{dev,prod,prod_end,rma}` declare the lock.
The default is a locked `secret2` in the `{dev,prod,prod_end,rma}` lc state.
Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Both `kmac_entropy_test` and `kmac_error_conditions_test` need KMAC to fetch its entropy from EDN, which is no longer possible once the ROM has configured KMAC in software entropy mode for the `keymgr_dpe` operations. Mark them as broken on the sival execution environment until lowRISC#30949 is resolved. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
See issue lowRISC#30957. Signed-off-by: Raphael Roth <rroth@lowrisc.org>
Due to the `keymgr_dpe` integration into `earlgrey` `secret2` is
locked in the default OTP images for {dev, prod, prod_end, rma}.
The test relies on having an unlocked `secret2` therefore it is
explicitly not locked.
Signed-off-by: Raphael Roth <rroth@lowrisc.org>
01f25f2 to
ca46fec
Compare
|
@gautschimi @engdoreis Thanks for your reviews, I implemented your suggestion or lakes a question in return. @gautschimi I directly changed the references from |
Thanks. Please reference an issue that is explaining the problem with this test. It might already exist |
I didn't find a issue, I opened #31000. I don't want to add the issue number somewhere in the code because its clearly related to the logger and not the |
PR9 - Top level integration
This PR is the ninth in a series which will replace the keymgr with the kemgr_dpe in earlgrey. The replacement was approved by this RFC.
Merge-Dependencies
Description
Replaces
keymgrwithkeymgr_dpeintop_earlgreyand migrates the software stack to match.A new top-level parameter
keymgr_dpe_seed_selectorchooses whether the creator/owner seed comes fromflash_ctrl(used by Earl Grey) orotp_ctrl.The
CreatorRootKeyderivation moves from the immutable ROM_EXT into the ROM per this RFC, and sealing/attestation keys now live in two parallel DPE slots instead of a single key chain, sosc_keymgr_key_type_tis dropped.On the software side this ports
rom,imm_section,dice_chain,ownership_key,otbn_boot_services,tpmandshutdown, and adds akeymgr_dpe_slot_idxfield tootcrypto_key_config_tto select the parent DPE context for sideloaded keys.Affected SW tests, DV sequences and testplans are updated here rather than in a follow-up, because the top-level swap breaks them as soon as it lands.
The
keymgr_dperequires to have a lockedsecret2OTP partition to derive any DPE context and becauseromalready uses thekeymgr_dpea lot of tests would fail. This PR locks thesecret2partition in the default OTP image in the following lifecycle states: dev, prod, prod_end, rma. With an otp_partition inbazelits possible to get an unlockedsecret2partition:Open points
This list encompass open points which either needs to be fixed before this PR is merged or a Issue is created.
ft_personalize.cis not yet updated and breaks when buildingcmac.cis not yet updated and breaks when buildingotbn_fi.c,otbn_sca.c,ibex_fi.c)sel_src_slotin the silicon driver (and all dependent files) toslot_src_selfor consistency with the register description.keymgr_dpeslot number #30777)Follow-ups issues: #30777, #30759, #30811, #30830, #30878, #30690, #30907.
Sidenote
The first commit encompasses all changes on the top-layer to replace the
keymgrwithkeymgr_dpe. I split all autogenerated code into a separate commit to allow for a faster review process.