Skip to content

Commit d94a429

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 bc2900d commit d94a429

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
@@ -1864,6 +1864,9 @@ pub struct FwInfoResp {
18641864
pub owner_pub_key_hash: [u32; 12],
18651865
pub authman_sha384_digest: [u32; 12],
18661866
pub most_recent_fw_error: u32,
1867+
pub image_manifest_pqc_type: u32,
1868+
pub vendor_ecc384_pub_key_index: u32,
1869+
pub vendor_pqc_pub_key_index: u32,
18671870
}
18681871

18691872
// CAPABILITIES

libcaliptra/inc/caliptra_types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ struct caliptra_fw_info_resp
216216
uint32_t owner_pub_key_hash[12];
217217
uint32_t authman_sha384_digest[12];
218218
uint32_t most_recent_fw_error;
219+
uint32_t image_manifest_pqc_type;
220+
uint32_t vendor_ecc384_pub_key_index;
221+
uint32_t vendor_pqc_pub_key_index;
219222
};
220223

221224
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.rom.manifest1.runtime.digest;
4747
resp.owner_pub_key_hash = pdata.rom.data_vault.owner_pk_hash().into();
4848
resp.authman_sha384_digest = pdata.fw.auth_manifest_digest;
49+
resp.image_manifest_pqc_type = pdata.rom.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().rom.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
@@ -195,6 +195,15 @@ fn test_fw_info() {
195195
assert_eq!(info.fmc_sha384_digest, image.manifest.fmc.digest);
196196
assert_eq!(info.runtime_sha384_digest, image.manifest.runtime.digest);
197197
assert_eq!(info.most_recent_fw_error, 0x0);
198+
assert_eq!(info.image_manifest_pqc_type, *pqc_key_type as u32);
199+
assert_eq!(
200+
info.vendor_ecc384_pub_key_index,
201+
image.manifest.preamble.vendor_ecc_pub_key_idx
202+
);
203+
assert_eq!(
204+
info.vendor_pqc_pub_key_index,
205+
image.manifest.preamble.vendor_pqc_pub_key_idx
206+
);
198207

199208
// Make image with newer SVN.
200209
let mut image_opts20 = image_opts.clone();
@@ -212,6 +221,15 @@ fn test_fw_info() {
212221
assert_eq!(info.fw_svn, 20);
213222
assert_eq!(info.min_fw_svn, 10);
214223
assert_eq!(info.cold_boot_fw_svn, 10);
224+
assert_eq!(info.image_manifest_pqc_type, *pqc_key_type as u32);
225+
assert_eq!(
226+
info.vendor_ecc384_pub_key_index,
227+
image.manifest.preamble.vendor_ecc_pub_key_idx
228+
);
229+
assert_eq!(
230+
info.vendor_pqc_pub_key_index,
231+
image.manifest.preamble.vendor_pqc_pub_key_idx
232+
);
215233

216234
// Make image with older SVN.
217235
let mut image_opts5 = image_opts;
@@ -227,13 +245,31 @@ fn test_fw_info() {
227245
assert_eq!(info.fw_svn, 5);
228246
assert_eq!(info.min_fw_svn, 5);
229247
assert_eq!(info.cold_boot_fw_svn, 10);
248+
assert_eq!(info.image_manifest_pqc_type, *pqc_key_type as u32);
249+
assert_eq!(
250+
info.vendor_ecc384_pub_key_index,
251+
image.manifest.preamble.vendor_ecc_pub_key_idx
252+
);
253+
assert_eq!(
254+
info.vendor_pqc_pub_key_index,
255+
image.manifest.preamble.vendor_pqc_pub_key_idx
256+
);
230257

231258
// Go back to SVN 20
232259
update_to(&mut model, &image20);
233260
let info = get_fwinfo(&mut model);
234261
assert_eq!(info.fw_svn, 20);
235262
assert_eq!(info.min_fw_svn, 5);
236263
assert_eq!(info.cold_boot_fw_svn, 10);
264+
assert_eq!(info.image_manifest_pqc_type, *pqc_key_type as u32);
265+
assert_eq!(
266+
info.vendor_ecc384_pub_key_index,
267+
image.manifest.preamble.vendor_ecc_pub_key_idx
268+
);
269+
assert_eq!(
270+
info.vendor_pqc_pub_key_index,
271+
image.manifest.preamble.vendor_pqc_pub_key_idx
272+
);
237273
}
238274
}
239275

0 commit comments

Comments
 (0)