Skip to content

Commit 205d47d

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 205d47d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lpc55_sign/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lpc55_sign"
3-
version = "0.3.4"
3+
version = "0.3.5"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

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)