Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/part/gen3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ pub struct CPDPartition {
pub cpd: CodePartitionDirectory,
}

impl CPDPartition {
pub fn check_signature(&self) -> Result<(), String> {
if let Ok((m, mdata)) = &self.cpd.manifest {
if m.verify(&mdata) {
return Ok(());
} else {
return Err("hash mismatch".into());
}
} else {
Err("no manifest found".into())
}
}
}

#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct DataPartition {
pub entry: FPTEntry,
Expand Down