Skip to content

Commit 44c2067

Browse files
committed
[fw_info] Add more information about how firmware was verified
This adds the following fields to `FwInfoResp`: * image_manifest_pqc_type * vendor_ecc384_pub_key_index * vendor_pqc_pub_key_index These will be used by MCU key revocation APIs to make sure it is safe to revoke a key.
1 parent 3a709fb commit 44c2067

4 files changed

Lines changed: 45 additions & 0 deletions

File tree

api/src/mailbox.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,9 @@ pub struct FwInfoResp {
14531453
pub owner_pub_key_hash: [u32; 12],
14541454
pub authman_sha384_digest: [u32; 12],
14551455
pub most_recent_fw_error: u32,
1456+
pub image_manifest_pqc_type: u32,
1457+
pub vendor_ecc384_pub_key_index: u32,
1458+
pub vendor_pqc_pub_key_index: u32,
14561459
}
14571460

14581461
// CAPABILITIES

libcaliptra/inc/caliptra_types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ struct caliptra_fw_info_resp
214214
uint32_t owner_pub_key_hash[12];
215215
uint32_t authman_sha384_digest[12];
216216
uint32_t most_recent_fw_error;
217+
uint32_t image_manifest_pqc_type;
218+
uint32_t vendor_ecc384_pub_key_index;
219+
uint32_t vendor_pqc_pub_key_index;
217220
};
218221

219222
struct caliptra_dpe_tag_tci_req

runtime/src/info.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ impl FwInfoCmd {
4646
resp.runtime_sha384_digest = pdata.manifest1.runtime.digest;
4747
resp.owner_pub_key_hash = pdata.data_vault.owner_pk_hash().into();
4848
resp.authman_sha384_digest = pdata.auth_manifest_digest;
49+
resp.image_manifest_pqc_type = pdata.manifest1.pqc_key_type as u32;
50+
resp.vendor_ecc384_pub_key_index = handoff.data_vault.vendor_ecc_pk_index();
51+
resp.vendor_pqc_pub_key_index = handoff.data_vault.vendor_pqc_pk_index();
4952
resp.most_recent_fw_error = match get_fw_error_non_fatal() {
5053
0 => drivers.persistent_data.get().cleared_non_fatal_fw_error,
5154
e => e,

runtime/tests/runtime_integration_tests/test_info.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,15 @@ fn test_fw_info() {
187187
assert_eq!(info.fmc_sha384_digest, image.manifest.fmc.digest);
188188
assert_eq!(info.runtime_sha384_digest, image.manifest.runtime.digest);
189189
assert_eq!(info.most_recent_fw_error, 0x0);
190+
assert_eq!(info.image_manifest_pqc_type, *pqc_key_type as u32);
191+
assert_eq!(
192+
info.vendor_ecc384_pub_key_index,
193+
image.manifest.preamble.vendor_ecc_pub_key_idx
194+
);
195+
assert_eq!(
196+
info.vendor_pqc_pub_key_index,
197+
image.manifest.preamble.vendor_pqc_pub_key_idx
198+
);
190199

191200
// Make image with newer SVN.
192201
let mut image_opts20 = image_opts.clone();
@@ -204,6 +213,15 @@ fn test_fw_info() {
204213
assert_eq!(info.fw_svn, 20);
205214
assert_eq!(info.min_fw_svn, 10);
206215
assert_eq!(info.cold_boot_fw_svn, 10);
216+
assert_eq!(info.image_manifest_pqc_type, *pqc_key_type as u32);
217+
assert_eq!(
218+
info.vendor_ecc384_pub_key_index,
219+
image.manifest.preamble.vendor_ecc_pub_key_idx
220+
);
221+
assert_eq!(
222+
info.vendor_pqc_pub_key_index,
223+
image.manifest.preamble.vendor_pqc_pub_key_idx
224+
);
207225

208226
// Make image with older SVN.
209227
let mut image_opts5 = image_opts;
@@ -219,13 +237,31 @@ fn test_fw_info() {
219237
assert_eq!(info.fw_svn, 5);
220238
assert_eq!(info.min_fw_svn, 5);
221239
assert_eq!(info.cold_boot_fw_svn, 10);
240+
assert_eq!(info.image_manifest_pqc_type, *pqc_key_type as u32);
241+
assert_eq!(
242+
info.vendor_ecc384_pub_key_index,
243+
image.manifest.preamble.vendor_ecc_pub_key_idx
244+
);
245+
assert_eq!(
246+
info.vendor_pqc_pub_key_index,
247+
image.manifest.preamble.vendor_pqc_pub_key_idx
248+
);
222249

223250
// Go back to SVN 20
224251
update_to(&mut model, &image20);
225252
let info = get_fwinfo(&mut model);
226253
assert_eq!(info.fw_svn, 20);
227254
assert_eq!(info.min_fw_svn, 5);
228255
assert_eq!(info.cold_boot_fw_svn, 10);
256+
assert_eq!(info.image_manifest_pqc_type, *pqc_key_type as u32);
257+
assert_eq!(
258+
info.vendor_ecc384_pub_key_index,
259+
image.manifest.preamble.vendor_ecc_pub_key_idx
260+
);
261+
assert_eq!(
262+
info.vendor_pqc_pub_key_index,
263+
image.manifest.preamble.vendor_pqc_pub_key_idx
264+
);
229265
}
230266
}
231267

0 commit comments

Comments
 (0)