[perso] Send back CWT UDS certificate from host to device during provisioning - #31036
Merged
timothytrippel merged 2 commits intoAug 27, 2026
Conversation
xorptr
force-pushed
the
perso_ft_provisioning_reduce_sram_usage_send_back_cwt_uds
branch
2 times, most recently
from
August 17, 2026 23:20
d642caf to
9f12b4c
Compare
sasdf
approved these changes
Aug 18, 2026
| stages_shared_data->blob_from_host.num_objs = num_objs_in_blob_from_host; | ||
| post_endorse_stages_shared_data->blob_from_host.num_objs = | ||
| num_objs_in_blob_from_host; | ||
|
|
Contributor
There was a problem hiding this comment.
Q: should we also reset the next_free here?
Author
cfrantz
approved these changes
Aug 19, 2026
cfrantz
left a comment
Contributor
There was a problem hiding this comment.
We need to determine if this change has any impact on the ot-provisioning infrastructure.
xorptr
force-pushed
the
perso_ft_provisioning_reduce_sram_usage_send_back_cwt_uds
branch
from
August 21, 2026 00:05
9f12b4c to
c29a70a
Compare
Contributor
|
please rebase to fix CI |
xorptr
force-pushed
the
perso_ft_provisioning_reduce_sram_usage_send_back_cwt_uds
branch
from
August 25, 2026 18:14
c29a70a to
f9caf9e
Compare
Author
|
Rebased on top of last commit in PR #31033 ( |
xorptr
force-pushed
the
perso_ft_provisioning_reduce_sram_usage_send_back_cwt_uds
branch
from
August 26, 2026 11:01
f9caf9e to
2ecf1ce
Compare
… it is This commit changes the behavior of the provisioning flow so that the firmware sends generated UDS CWT DICE certificate to the host, and then expects the host to send it back. This allows for saving space in SRAM by using only one perso blob variable (done in a later commit as a mechanical refactor of code). 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 Signed-off-by: Lovepreet Singh <lpsingh@google.com>
xorptr
force-pushed
the
perso_ft_provisioning_reduce_sram_usage_send_back_cwt_uds
branch
from
August 26, 2026 23:49
2ecf1ce to
d340988
Compare
…ve at time
The device no longer needs to use the perso blob it sent to the host
after changes in previous commit where the host sends back UDS CWT
certificate. Therefore, only one of those variables need to be live at a
given time: `blob_to_host` during pre-endorsement stage and
`blob_from_host` during post-endorsement stage.
This commit does a mechanical refactor to split the perso blob variables
into appropriate union fields so that device SRAM usage can be reduced.
`blob_from_host` is moved to shared post-endorsement since it is used in
stage 1 and after stage 2.
I also deleted variable to keep track of UDS CWT certificate offset in
blob_to_host since it is not needed anymore.
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
Output from `bloaty` for `.bss` section in
`ft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elf`
before this change:
```
0.0% 0 17.7% 27.4Ki .bss
NAN% 0 75.5% 20.7Ki provision.perso_data
NAN% 0 14.6% 4.00Ki owner_page
NAN% 0 7.2% 1.97Ki main_spi_buf
NAN% 0 1.0% 272 ottf_console_spi_getc.info
NAN% 0 0.4% 100 pxReadyTasksLists
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
```
Output from `bloaty` for `.bss` section in
`ft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elf`
after this change:
```
0.0% 0 14.9% 22.4Ki .bss
NAN% 0 70.0% 15.7Ki provision.perso_data
NAN% 0 17.8% 4.00Ki owner_page
NAN% 0 8.8% 1.97Ki main_spi_buf
NAN% 0 1.2% 272 ottf_console_spi_getc.info
NAN% 0 0.4% 100 pxReadyTasksLists
NAN% 0 0.2% 52 main_console
NAN% 0 0.2% 40 status_report_list
```
Signed-off-by: Lovepreet Singh <lpsingh@google.com>
xorptr
force-pushed
the
perso_ft_provisioning_reduce_sram_usage_send_back_cwt_uds
branch
from
August 27, 2026 00:49
d340988 to
e1837fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, during provisioning the device firmware generates CWT UDS certificate during pre-endorsement stage. The host does not send it back with other endorsed certificates, so during the post-endorsement stage the device uses data from the blob it sent to the host. This necessitates keeping both the blob sent to the host and blob received from the host live during the post-endorsement stage.
This PR changes the provisioning flow so that the host sends CWT UDS certificate back to the device (without doing any endorsement, which is similar to existing behavior). This allows splitting the perso blob to host and perso blob from host into stage specific union variables. This saves ~5KiB space in
.bsssection in SRAM. NOTE: This assumes that the pre-endorsement SKU extension logic will not keep any references to the blob sent to the host for use during post-endorsement SKU extension logic.Changes are on top on PR #31033
Output from
bloatyfor.bsssection inft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elfbefore this change:Output from
bloatyfor.bsssection inft_personalize_emulation_dice_mldsa_sim_qemu_rom_with_fake_keys.elfafter this change: