Skip to content

[perso] Remove CDI 0 and CDI 1 generation and endorsement during provisioning - #31033

Open
xorptr wants to merge 16 commits into
lowRISC:earlgrey_1.0.0from
xorptr:perso_ft_provisioning_reduce_sram_usage_remove_cdi0_and_cdi1
Open

[perso] Remove CDI 0 and CDI 1 generation and endorsement during provisioning#31033
xorptr wants to merge 16 commits into
lowRISC:earlgrey_1.0.0from
xorptr:perso_ft_provisioning_reduce_sram_usage_remove_cdi0_and_cdi1

Conversation

@xorptr

@xorptr xorptr commented Aug 17, 2026

Copy link
Copy Markdown

Based on changes in PR #31014, I observed that perso blob to and from host need to be live together during provisioning. This takes ~10KiB of space in SRAM (~5KiB for each blob object).

One approach to reduce the SRAM usage is to change the flow such that only one of those objects need to be live at a given time. Since the device firmware only uses perso blob to host in order to read the device endorsed certificates and write them to internal flash, one approach to achieve the goal is to have the host send back the device endorsed certificates and have the device firmware read them from blob send from host. Currently, the device endorsed certificates include: CWT UDS, CDI 0, and CDI 1.

@sasdf and @cfrantz suggested that we could remove CDI 0 and CDI 1 certificates from the provisioning flow since ROM_EXT is supposed to re-generate them during boot. After discussion with @timothytrippel, I decided to use this approach.

This PR makes changes to remove CDI 0 and CDI 1 generation from device firmware during the provisioning flow. The host now only expects UDS certificate and SKU extension specific certificates.

I also made changes to the CWT dice chain validation on the host side since the code currently expects at least 2 certs in the chain.

I also added minor change to add calls to sc_keymgr_sw_binding_unlock_wait where it seems appropriate during the provisioning flow

This PR does not actually split the perso blob to and from host yet (mentioned as the goal earlier in the description). I will make the changes to split them in a follow-up PR

sasdf added 4 commits August 13, 2026 11:49
…blob_v1 target

Remove the blob_version attribute from the sku_cfg Bazel rule, the
SkuConfig Python dataclass, and the ot_dut.py CLI builder, and remove
the unused emulation_blob_v1 target from BUILD and provisioning_inputs.bzl.

TAG=agy
CONV=f24c5c61-71d1-4fc3-aef0-af78d1125515

Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
Change-Id: If644fb28344e83937ccd261bb241a2de6a6a6964
… FT tool

Add per-object TLV format version detection and construction to
perso_tlv_lib. Update ObjHeader with header_size and version, add
MAX_CERT_NAME_LEN and MAX_CERT_LEN constants to PersoTlvTypes, and
update ft_lib to use PersoBlobParser::new() and PersoBlobBuilder::new().

TAG=agy
CONV=f24c5c61-71d1-4fc3-aef0-af78d1125515

Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
Change-Id: I9d1871e5ad93152b80a7d13725f27e146a6a6964
…ary and firmware

Add 4-byte V1 version prefix (0x010004F0) handling to device perso_tlv_data.
Update perso_tlv_get_cert_obj, perso_tlv_object_type, and perso_tlv_object_size
to detect object version from buffer without external blob_version arguments.
Update ft_personalize.c and test callers accordingly.

TAG=agy
CONV=f24c5c61-71d1-4fc3-aef0-af78d1125515

Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
Change-Id: I0db63e5d5adf3fa35d9a95fd0bceb4296a6a6964
Remove the blob_version field from manuf_certgen_inputs_t ujson struct
and test harnesses, and remove the BlobVersion enum and --blob-version
CLI argument from sw/host/provisioning/ft.

TAG=agy
CONV=f24c5c61-71d1-4fc3-aef0-af78d1125515

Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
Change-Id: I7cad734f7db2b98202d1405052ad71236a6a6964
@xorptr
xorptr requested review from a team and cfrantz as code owners August 17, 2026 20:43
@xorptr
xorptr requested review from pamaury and removed request for a team August 17, 2026 20:43
@xorptr
xorptr force-pushed the perso_ft_provisioning_reduce_sram_usage_remove_cdi0_and_cdi1 branch from 5f6f297 to cf8a61a Compare August 17, 2026 23:13
xorptr and others added 2 commits August 19, 2026 08:04
Currently, the firmware stores number of objects in perso blob from host
after extracting the "UDS" certificate. There may or may not be object
present before the "UDS" certificate TLV object. Then the firmware
changes the `num_objs` in `perso_blob_from_host`, and later restores it
from the temporary variable initialized after extracting the "UDS"
certificate.

This commit changes the behavior to store the number of objects
received from the host in perso blob just after receiving the blob

Signed-off-by: Lovepreet Singh <lpsingh@google.com>

(cherry picked from commit 0d6d1c0)
Prefix the ML-DSA certificate in data flash with the 4-byte V1 version object
(kPersoTlvVersionPrefixV1 = 0x010004F0). Null-pad the name array to 12 bytes
for "PQ_CDI_0" and "PQ_CDI_1" and set the cert header name length to 12 to
produce a 24-byte header (a multiple of 8 for flash write alignment).

TAG=agy
CONV=f24c5c61-71d1-4fc3-aef0-af78d1125515

Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
Change-Id: I00567f31f224981bfe09ec87475ebdd16a6a6964

@cfrantz cfrantz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to determine if this change has any impact on the ot-provisioning infrastructure.

xorptr added 10 commits August 20, 2026 15:39
…ped static variables

This commits moves most of the global static variables into function
local scope.

The motive behind this refactor is to allow better reason about the
liveness of these variables when doing future changes to this code.
The declarations are pushed as deep in the call chain as possible based
on how the variables are used currently

- I removed `static` qualifier from `uds_key_ids` and `cdi_0_key_ids`
  since the compiler could not statically initialize fields with
  `uds_pubkey_id` (because now it is an input to the function)

- I added checks for size of `all_certs` against max size of DICE
  certificates. This should not cause any behavior change since
  `all_certs` is statically allocated to be much larger than max size of
  DICE certificates

- I removed `orig_num_objects_from_host`. Instead the function now has a
  local variable to temporarily store the original count, and the count
  is restored before the function returns

Size for few entries in `.bss` section from
`ft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elf`
after this change:

```
0.0%       0  18.6%  30.4Ki    .bss
  NAN%       0  26.4%  8.00Ki    provision.all_certs
  NAN%       0  16.5%  5.01Ki    provision.blob_from_host
  NAN%       0  16.5%  5.01Ki    provision.blob_to_host
  NAN%       0  13.2%  4.00Ki    owner_page
  NAN%       0   6.6%  2.00Ki    personalize_endorse_certificates.dice_page
  NAN%       0   6.5%  1.97Ki    main_spi_buf
  NAN%       0   3.3%    1024    hash_certificate.cert_buffer
  NAN%       0   2.3%     708    measure_otp_partition.otp_state
  NAN%       0   1.9%     588    cdi_1_tbs_buffer
  NAN%       0   1.6%     488    cdi_0_tbs_buffer
  NAN%       0   0.9%     272    ottf_console_spi_getc.info
  NAN%       0   0.7%     224    otbn_boot_attestation_key_clear.dmem_backup
  NAN%       0   0.3%     100    pxReadyTasksLists
  NAN%       0   0.2%      64    curr_tbs_signature
  NAN%       0   0.2%      64    personalize_gen_dice_certificates.cdi_0_pubkey
  NAN%       0   0.2%      64    personalize_gen_dice_certificates.curr_pubkey
  NAN%       0   0.2%      64    provision.uds_pubkey
  NAN%       0   0.2%      52    main_console
  NAN%       0   0.1%      40    provision.certgen_inputs
  NAN%       0   0.1%      40    status_report_list
  NAN%       0   0.1%      32    personalize_gen_dice_certificates.attestation_binding_value
  NAN%       0   0.1%      32    personalize_gen_dice_certificates.cdi_0_pubkey_id
  NAN%       0   0.1%      32    personalize_gen_dice_certificates.cdi_1_pubkey_id
  NAN%       0   0.1%      32    personalize_gen_dice_certificates.sealing_binding_value
  NAN%       0   0.1%      32    personalize_gen_dice_certificates.uds_endorsement_key_id
  NAN%       0   0.1%      32    personalize_gen_dice_certificates.zero_digest
  NAN%       0   0.1%      32    provision.otp_creator_sw_cfg_measurement
  NAN%       0   0.1%      32    provision.otp_owner_sw_cfg_measurement
  NAN%       0   0.1%      32    provision.otp_rot_creator_auth_codesign_measurement
  NAN%       0   0.1%      32    provision.otp_rot_creator_auth_state_measurement
  NAN%       0   0.1%      32    provision.uds_pubkey_id
```

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
This commit removes `static` qualifier from few static variables which
were moved to function scope in the previous commit. I arbitraily chose
32 bytes as the limit so as to not increase the total stack usage while
also reducing a little bit of `.bss` section use. The stack variables
are zero-initialized as they were earlier when they were static

Size for few entries in `.bss` section from
`ft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elf`
after this change:

```
0.0%       0  18.5%  30.1Ki    .bss
  NAN%       0  26.6%  8.00Ki    provision.all_certs
  NAN%       0  16.7%  5.01Ki    provision.blob_from_host
  NAN%       0  16.7%  5.01Ki    provision.blob_to_host
  NAN%       0  13.3%  4.00Ki    owner_page
  NAN%       0   6.7%  2.00Ki    personalize_endorse_certificates.dice_page
  NAN%       0   6.6%  1.97Ki    main_spi_buf
  NAN%       0   3.3%    1024    hash_certificate.cert_buffer
  NAN%       0   2.3%     704    measure_otp_partition.otp_state
  NAN%       0   1.9%     588    cdi_1_tbs_buffer
  NAN%       0   1.6%     488    cdi_0_tbs_buffer
  NAN%       0   0.9%     272    ottf_console_spi_getc.info
  NAN%       0   0.7%     224    otbn_boot_attestation_key_clear.dmem_backup
  NAN%       0   0.3%     100    pxReadyTasksLists
  NAN%       0   0.2%      64    curr_tbs_signature
  NAN%       0   0.2%      64    personalize_gen_dice_certificates.cdi_0_pubkey
  NAN%       0   0.2%      64    personalize_gen_dice_certificates.curr_pubkey
  NAN%       0   0.2%      64    provision.uds_pubkey
  NAN%       0   0.2%      52    main_console
  NAN%       0   0.1%      40    provision.certgen_inputs
  NAN%       0   0.1%      40    status_report_list
  NAN%       0   0.1%      32    personalize_gen_dice_certificates.attestation_binding_value
  NAN%       0   0.1%      32    personalize_gen_dice_certificates.sealing_binding_value
```

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
This commits makes appropriate function parameters `const` qualified.
The motive behind this change is to make it easier to reason about
mutability of the static variables left in the previous commit.

A notable refactor in this commit is change from
`perso_tlv_get_cert_obj` to `perso_tlv_get_cert_obj_view`. The new
function now returns `perso_tlv_cert_obj_view_t` instead of
`perso_tlv_cert_obj_t`. `perso_tlv_cert_obj_view_t` is similar to
`perso_tlv_cert_obj_t`, but internally it uses const pointers to the
underlying buffer (hence giving only immutable access/view to the
underlying buffer). This allows making the buffer passed to
`perso_tlv_get_cert_obj_view` `const` qualified, which in turn helps
confirm that `personalize_endorse_certificates` uses `blob_to_host` only
for reads.

I also changes `zero_digest` to `const static` so that it can be moved
to `.rodata`

Size for few entries in `.bss` section from
`ft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elf`
after this change:

```
0.0%       0  18.5%  30.1Ki    .bss
  NAN%       0  26.6%  8.00Ki    provision.all_certs
  NAN%       0  16.7%  5.01Ki    provision.blob_from_host
  NAN%       0  16.7%  5.01Ki    provision.blob_to_host
  NAN%       0  13.3%  4.00Ki    owner_page
  NAN%       0   6.7%  2.00Ki    personalize_endorse_certificates.dice_page
  NAN%       0   6.6%  1.97Ki    main_spi_buf
  NAN%       0   3.3%    1024    hash_certificate.cert_buffer
  NAN%       0   2.3%     704    measure_otp_partition.otp_state
  NAN%       0   1.9%     588    cdi_1_tbs_buffer
  NAN%       0   1.6%     488    cdi_0_tbs_buffer
  NAN%       0   0.9%     272    ottf_console_spi_getc.info
  NAN%       0   0.7%     224    otbn_boot_attestation_key_clear.dmem_backup
  NAN%       0   0.3%     100    pxReadyTasksLists
  NAN%       0   0.2%      64    curr_tbs_signature
  NAN%       0   0.2%      64    personalize_gen_dice_certificates.cdi_0_pubkey
  NAN%       0   0.2%      64    personalize_gen_dice_certificates.curr_pubkey
  NAN%       0   0.2%      64    provision.uds_pubkey
  NAN%       0   0.2%      52    main_console
  NAN%       0   0.1%      40    provision.certgen_inputs
  NAN%       0   0.1%      40    status_report_list
  NAN%       0   0.1%      32    personalize_gen_dice_certificates.attestation_binding_value
  NAN%       0   0.1%      32    personalize_gen_dice_certificates.sealing_binding_value
```

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
…chain

This commit moves the static variables that were not marked with `const`
qualifier up in the call chain. I have moved them to the function where
the 2 major stages of provisioning occur: pre-endorsement and
post-endorsement. The motive behind this changes is to (in the future)
split the variables into different sets based on which stages use them

I also added 2 types `cert_scratch_buffer_t` and
`aligned_dice_storage_page_t` so that the alignment requirement on
`cert_buffer` and `dice_page` can be expressed in function parameters
until it is not needed anymore

Size for few entries in `.bss` section from
`ft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elf`
after this change:

```
0.0%       0  18.5%  30.1Ki    .bss
  NAN%       0  26.6%  8.00Ki    provision.all_certs
  NAN%       0  16.7%  5.01Ki    provision.blob_from_host
  NAN%       0  16.7%  5.01Ki    provision.blob_to_host
  NAN%       0  13.3%  4.00Ki    owner_page
  NAN%       0   6.7%  2.00Ki    provision.dice_page
  NAN%       0   6.6%  1.97Ki    main_spi_buf
  NAN%       0   3.3%    1024    provision.cert_buffer
  NAN%       0   2.3%     704    provision.otp_state
  NAN%       0   1.9%     588    cdi_1_tbs_buffer
  NAN%       0   1.6%     488    cdi_0_tbs_buffer
  NAN%       0   0.9%     272    ottf_console_spi_getc.info
  NAN%       0   0.7%     224    otbn_boot_attestation_key_clear.dmem_backup
  NAN%       0   0.3%     100    pxReadyTasksLists
  NAN%       0   0.2%      64    curr_tbs_signature
  NAN%       0   0.2%      64    provision.cdi_0_pubkey
  NAN%       0   0.2%      64    provision.curr_pubkey
  NAN%       0   0.2%      64    provision.uds_pubkey
  NAN%       0   0.2%      52    main_console
  NAN%       0   0.1%      40    provision.certgen_inputs
  NAN%       0   0.1%      40    status_report_list
  NAN%       0   0.1%      32    provision.attestation_binding_value
  NAN%       0   0.1%      32    provision.sealing_binding_value
```

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
This commit splits the static variables moved up the call chain in the
previous commit. The variables are split into 2 categories at first
level: variables that are used by both pre-endorsement and
post-endorsement stages, and variables that are used by only one of
those stages. The variables used only by one stage are put into a union
to save space in SRAM. Since the stages occur one after another, only
the stage specific and shared variables need to be live for a given
stage.

**NOTE: This optimization assumes that
`personalize_extension_pre_cert_endorse` does not store any references
to the pre-endorsement stage specific data after the call ends.** Since
the underlying buffer will be re-used for post endorsement specific
data, the data pointed to by such references will get invalidated.

Size for few entries in `.bss` section from
`ft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elf`
after this change:

```
0.0%       0  18.3%  29.8Ki    .bss
  NAN%       0  72.9%  21.7Ki    provision.perso_data
  NAN%       0  13.4%  4.00Ki    owner_page
  NAN%       0   6.6%  1.97Ki    main_spi_buf
  NAN%       0   1.9%     588    cdi_1_tbs_buffer
  NAN%       0   1.6%     488    cdi_0_tbs_buffer
  NAN%       0   0.9%     272    ottf_console_spi_getc.info
  NAN%       0   0.7%     224    otbn_boot_attestation_key_clear.dmem_backup
  NAN%       0   0.3%     100    pxReadyTasksLists
  NAN%       0   0.2%      64    curr_tbs_signature
  NAN%       0   0.2%      52    main_console
  NAN%       0   0.1%      40    status_report_list
  NAN%       0   0.1%      24    rand_testutils_rng_ctx
```

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
This commit changes the function signatures to reduce the number of
parameters. In the previous commit, the functions had too many
parameters and many parameters had the same type. So a simple mistake
such as swapping 2 parameters in the long list would be hard to detect.
With a smaller list and different types for parameters where possible,
such mistakes could be avoided. New types are also added to help with
reducing the parameters count.

Size for few entries in `.bss` section from
`ft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elf`
after this change:

```
0.0%       0  18.3%  29.8Ki    .bss
  NAN%       0  72.9%  21.7Ki    provision.perso_data
  NAN%       0  13.4%  4.00Ki    owner_page
  NAN%       0   6.6%  1.97Ki    main_spi_buf
  NAN%       0   1.9%     588    cdi_1_tbs_buffer
  NAN%       0   1.6%     488    cdi_0_tbs_buffer
  NAN%       0   0.9%     272    ottf_console_spi_getc.info
  NAN%       0   0.7%     224    otbn_boot_attestation_key_clear.dmem_backup
  NAN%       0   0.3%     100    pxReadyTasksLists
  NAN%       0   0.2%      64    curr_tbs_signature
  NAN%       0   0.2%      52    main_console
  NAN%       0   0.1%      40    status_report_list
  NAN%       0   0.1%      24    rand_testutils_rng_ctx
  NAN%       0   0.1%      20    xDelayedTaskList1
```

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
… in union

Based on the observation that `dice_page` and `certs_buffer` are not
live together, this commit further splits post-endorsement stage
specific static variables into 2 groups and puts them into a union. This
saves a little bit more space in `.bss` section.

Size for few entries in `.bss` section from
`ft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elf`
after this change:

```
0.0%       0  17.8%  28.8Ki    .bss
  NAN%       0  72.0%  20.7Ki    provision.perso_data
  NAN%       0  13.9%  4.00Ki    owner_page
  NAN%       0   6.9%  1.97Ki    main_spi_buf
  NAN%       0   2.0%     588    cdi_1_tbs_buffer
  NAN%       0   1.7%     488    cdi_0_tbs_buffer
  NAN%       0   0.9%     272    ottf_console_spi_getc.info
  NAN%       0   0.8%     224    otbn_boot_attestation_key_clear.dmem_backup
  NAN%       0   0.3%     100    pxReadyTasksLists
  NAN%       0   0.2%      64    curr_tbs_signature
  NAN%       0   0.2%      52    main_console
  NAN%       0   0.1%      40    status_report_list
  NAN%       0   0.1%      24    rand_testutils_rng_ctx
  NAN%       0   0.1%      20    xDelayedTaskList1
```

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
…itionals

Putting statement for single line conditionals in curly braces so that
someone is less likely to make a mistake when new statements are added

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
…provisioning

This commit changes perso firmware code to NOT generate CDI_0 and CDI_1
certificates during provisioning flow. The current behavior is as
follows:

1. Device generates
   [CDI_0](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/device/silicon_creator/manuf/base/ft_personalize.c#L655-L656)
   and [CDI_1](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/device/silicon_creator/manuf/base/ft_personalize.c#L675-L677)
   endorsed certificates with zeroed out digest value and sends them to
   the host along with the generated UDS TBS certificate

2. Host uses these endorsed certificates to [compute the hash](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/host/provisioning/ft_lib/src/lib.rs#L419-L422)
   of the data that device is expected to write to the flash

3. Host DOES NOT send endorsed CDI_0 and CDI_1 certificates back to the
   device. Host does send endorsed UDS certificate (see
   [code](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/host/provisioning/ft_lib/src/lib.rs#L381))

4. Device reads endorsed UDS certificate sent by the host for X.509, or
   from blob sent to the host for CWT. Device reads endorsed CDI_0 and
   CDI_1 certificates from blob sent to the host (see
   [code](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/device/silicon_creator/manuf/base/ft_personalize.c#L990-L1016))

5. Device writes endorsed UDS certificate to FACTORY page, and endorsed
   CDI_0 and CDI_1 certificates to DICE page (see
   [code](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/device/silicon_creator/manuf/base/ft_personalize.c#L1059-L1084))

6. Device [reads and hashes endorsed UDS, CDI_0, and CDI_1
   certificates](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/device/silicon_creator/manuf/base/ft_personalize.c#L502-L537)
   along with other data, and [sends them to the
   host](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/device/silicon_creator/manuf/base/ft_personalize.c#L1230-L1231)

7. Host checks the device hash against the hash it expects (see
   [code](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/host/provisioning/ft_lib/src/lib.rs#L453-L475))

The new behavior is as follows:

1. Device only generates UDS TBS certificate for DICE chain and sends it
   to the host for endorsement

2. Host only takes into account endorsed UDS certificate (for the DICE
   chain) when computing the hash it expects later

3. Host sends endorsed UDS certificate back to the device

4. Device reads endorsed UDS certificate sent by the host for X.509, or
   from the blob sent to the host for CWT.

5. Device only writes endorsed UDS certificate (for the DICE chain) to
   FACTORY page

6. Device computed hash only includes endorsed UDS certificate (for the
   DICE chain). Device sends the computed hash to the host

7. Host checks the hash sent by the device against the hash it expects

NOTES:
1. I have still kept the "DICE" page marked as "used" in the flash
layout list since I am not sure if the extensions look for the first
unused page to determine pages that are available to them

2. I changed the logic to validate the DICE CWT chain since [it needs at
   least 2
   certificates](https://android.googlesource.com/platform/tools/security/+/d80118316fb3b87092d4128196884b11fa19e08c/remote_provisioning/hwtrust/src/cbor/dice/chain.rs#109).
   This has a side effect that the generated UDS certificate will not be
   checked for valid form since it is not parsed
   [earlier](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/host/provisioning/ft_lib/src/lib.rs#L416-L418)
   as well

Tested by running
`//sw/host/provisioning/orchestrator/tests:e2e_emulation_dice_cwt_cw340_test`,
`//sw/host/provisioning/orchestrator/tests:e2e_emulation_dice_mldsa_cw340_test`
`//sw/host/provisioning/orchestrator/tests:e2e_emulation_cw340_test`,
and `//sw/host/provisioning/orchestrator/tests:e2e_multistage_emulation_tpm_cw340_test`
targets locally
…iate locations

The [documentation](https://github.com/lowRISC/opentitan/blob/9d35c96fc0728d82fcc0a0e1ffa06ab532dbe448/sw/device/silicon_creator/lib/drivers/keymgr.h#L111-L134)
for keymgr functions mention that call to `sc_keymgr_sw_binding_unlock_wait` is
recommended after calls to `sc_keymgr_sw_binding_set` or
`sc_keymgr_advance_state`. This commit adds calls to
`sc_keymgr_sw_binding_unlock_wait` at appropriate locations in
`sw/device/silicon_creator/manuf/base/ft_personalize.c` as per that
documentation

Tested by running
`//sw/host/provisioning/orchestrator/tests:e2e_emulation_dice_mldsa_cw340_test`,
and  `//sw/host/provisioning/orchestrator/tests:e2e_emulation_cw340_test`
targets locally

Signed-off-by: Lovepreet Singh <lpsingh@google.com>
@xorptr
xorptr force-pushed the perso_ft_provisioning_reduce_sram_usage_remove_cdi0_and_cdi1 branch from cf8a61a to f2874f8 Compare August 20, 2026 23:54
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