Skip to content

Commit 05f88ac

Browse files
authored
fix: Correct the payload of claim signature box when calculating the hash. (#1466)
Correct the payload of claim signature box when calculating the hash.
1 parent c4fc7a6 commit 05f88ac

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sdk/src/claim.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ use crate::{
5858
jumbf::{
5959
self,
6060
boxes::{
61-
BMFFBox, CAICBORAssertionBox, CAIJSONAssertionBox, CAISignatureBox,
61+
CAICBORAssertionBox, CAIJSONAssertionBox, CAISignatureBox,
6262
CAIUUIDAssertionBox, JUMBFCBORContentBox, JumbfEmbeddedFileBox,
6363
},
6464
labels::{
@@ -1231,7 +1231,7 @@ impl Claim {
12311231
let sigc = JUMBFCBORContentBox::new(signed_data);
12321232
sigb.add_signature(Box::new(sigc));
12331233

1234-
sigb.write_box_payload(&mut hash_bytes)?;
1234+
sigb.super_box().write_box_payload(&mut hash_bytes)?;
12351235

12361236
Ok(hash_by_alg(alg, &hash_bytes, None))
12371237
}

sdk/src/jumbf/boxes.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,10 @@ impl CAISignatureBox {
925925
pub fn add_signature(&mut self, b: Box<dyn BMFFBox>) {
926926
self.sig_box.add_data_box(b)
927927
}
928+
929+
pub fn super_box(&self) -> &dyn BMFFBox {
930+
&self.sig_box
931+
}
928932
}
929933

930934
impl Default for CAISignatureBox {

0 commit comments

Comments
 (0)