Skip to content

Commit 30eeefb

Browse files
jaccoo01adeaarm
authored andcommitted
RSE: Write ROTPK policies on update
Previous fixes to the RSE ROTPK revocation code missed writing the policy field in the ROTPK structure. This needs to be added to each of the ROTPK update functions. Change-Id: Idbdf9fd17d0953a0b93cafdb154485585d192aab Signed-off-by: Jackson Cooper-Driver <[email protected]>
1 parent d8683e9 commit 30eeefb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

platform/ext/target/arm/rse/common/rse_rotpk_revocation.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ enum tfm_plat_err_t rse_update_cm_rotpks(uint32_t policies, uint8_t *rotpks, siz
8787
return TFM_PLAT_ERR_CM_ROTPK_UPDATE_INVALID_AREA;
8888
}
8989

90+
lcm_err = lcm_otp_write(&LCM_DEV_S,
91+
OTP_OFFSET(P_RSE_OTP_CM->rotpk_areas[new_idx].cm_rotpk_policies),
92+
sizeof(policies), (uint8_t *)&policies);
93+
if (lcm_err != LCM_ERROR_NONE) {
94+
return (enum tfm_plat_err_t)lcm_err;
95+
}
96+
9097
lcm_err = lcm_otp_write(&LCM_DEV_S, OTP_OFFSET(P_RSE_OTP_CM->rotpk_areas[new_idx].rotpk),
9198
rotpks_len, rotpks);
9299
if (lcm_err != LCM_ERROR_NONE) {
@@ -137,6 +144,13 @@ enum tfm_plat_err_t rse_update_dm_rotpks(uint32_t policies, uint8_t *rotpks, siz
137144
return TFM_PLAT_ERR_DM_ROTPK_UPDATE_INVALID_AREA;
138145
}
139146

147+
lcm_err = lcm_otp_write(&LCM_DEV_S,
148+
OTP_OFFSET(P_RSE_OTP_DM->rotpk_areas[new_idx].dm_rotpk_policies),
149+
sizeof(policies), (uint8_t *)&policies);
150+
if (lcm_err != LCM_ERROR_NONE) {
151+
return (enum tfm_plat_err_t)lcm_err;
152+
}
153+
140154
lcm_err = lcm_otp_write(&LCM_DEV_S, OTP_OFFSET(P_RSE_OTP_DM->rotpk_areas[new_idx].rotpk),
141155
rotpks_len, rotpks);
142156
if (lcm_err != LCM_ERROR_NONE) {

0 commit comments

Comments
 (0)