Skip to content

Commit 4d5e43e

Browse files
tommychiu-githubtimothytrippel
authored andcommitted
[manuf] Restore the num_objs for perso_blob_from_host
num_objs will be updated during personalize_endorse_certificates() which leads to personalize_extension_post_cert_endorse() gets incorrect value. Signed-off-by: Tommy Chiu <[email protected]>
1 parent 7e07c8b commit 4d5e43e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sw/device/silicon_creator/manuf/base/ft_personalize.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,7 @@ static status_t write_digest_to_dice_page(
885885
return OK_STATUS();
886886
}
887887

888+
size_t orig_num_objects_from_host;
888889
static status_t personalize_endorse_certificates(ujson_t *uj) {
889890
/*****************************************************************************
890891
* Certificate Export and Endorsement.
@@ -956,6 +957,7 @@ static status_t personalize_endorse_certificates(ujson_t *uj) {
956957
free_room -= block.obj_size;
957958
}
958959

960+
orig_num_objects_from_host = perso_blob_from_host.num_objs;
959961
// Extract the remaining cert perso LTV objects received from the host.
960962
while (perso_blob_from_host.num_objs)
961963
TRY(extract_next_cert(&next_cert, &free_room));
@@ -1148,6 +1150,7 @@ static status_t provision(ujson_t *uj) {
11481150
.uj = uj,
11491151
.perso_blob_from_host = &perso_blob_from_host,
11501152
.cert_flash_layout = cert_flash_layout};
1153+
post_endorse.perso_blob_from_host->num_objs = orig_num_objects_from_host;
11511154
TRY(personalize_extension_post_cert_endorse(&post_endorse));
11521155

11531156
// Check the hash of all perso objects with the host to confirm integrity of

0 commit comments

Comments
 (0)