Skip to content

Commit ef2d6ab

Browse files
committed
Check for root key table hash mismatch
Commit `f05c063e4b68926069efa0edb1159c8a2dbd9253` factored out some of the code for calculating the root key table hash but missed adding the final check against the CMPA. Bring it back.
1 parent b507bc6 commit ef2d6ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lpc55_sign/src/verify.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@ pub fn print_cfpa(cfpa: CFPAPage) -> Result<(), Error> {
375375
fn check_signed_image(image: &[u8], cmpa: CMPAPage, cfpa: CFPAPage) -> Result<(), Error> {
376376
let (cert_block, digest, signature) = image_certs_and_sig(image)?;
377377

378+
if cert_block.root_key_table_hash != cmpa.rotkh {
379+
return Err(Error::RotkhMismatch);
380+
}
381+
378382
let mut prev_public_key = None;
379383
for cert in cert_block.certs.iter() {
380384
let cmpa_rsa4k = cmpa.get_secure_boot_cfg()?.rsa4k;

0 commit comments

Comments
 (0)