@@ -1152,7 +1152,7 @@ impl Ingredient {
1152
1152
1153
1153
// add the ingredient manifest_data to the claim
1154
1154
// this is how any existing claims are added to the new store
1155
- let c2pa_manifest = match self . manifest_data_ref ( ) {
1155
+ let ( active_manifest , claim_signature ) = match self . manifest_data_ref ( ) {
1156
1156
Some ( resource_ref) => {
1157
1157
let manifest_label = self
1158
1158
. active_manifest
@@ -1191,14 +1191,13 @@ impl Ingredient {
1191
1191
{
1192
1192
let hash = ingredient_store
1193
1193
. get_manifest_box_hashes ( ingredient_active_claim)
1194
- . manifest_box_hash ; // get C2PA 1.2 JUMBF box hash
1195
-
1196
- // todo: must use this when making v3
1197
- let _sig_hash = ingredient_store
1194
+ . manifest_box_hash ; // get C2PA 1.2 JUMBF box
1195
+ let sig_hash = ingredient_store
1198
1196
. get_manifest_box_hashes ( ingredient_active_claim)
1199
1197
. signature_box_hash ; // needed for v3 ingredients
1200
1198
1201
1199
let uri = jumbf:: labels:: to_manifest_uri ( & manifest_label) ;
1200
+ let signature_uri = jumbf:: labels:: to_signature_uri ( & manifest_label) ;
1202
1201
1203
1202
// if there are validations and they have all passed, then use the parent claim thumbnail if available
1204
1203
if let Some ( validation_status) = self . validation_status . as_ref ( ) {
@@ -1221,19 +1220,26 @@ impl Ingredient {
1221
1220
}
1222
1221
}
1223
1222
// generate c2pa_manifest hashed_uri
1224
- Some ( crate :: hashed_uri:: HashedUri :: new (
1225
- uri,
1226
- Some ( ingredient_active_claim. alg ( ) . to_owned ( ) ) ,
1227
- hash. as_ref ( ) ,
1228
- ) )
1223
+ (
1224
+ Some ( crate :: hashed_uri:: HashedUri :: new (
1225
+ uri,
1226
+ Some ( ingredient_active_claim. alg ( ) . to_owned ( ) ) ,
1227
+ hash. as_ref ( ) ,
1228
+ ) ) ,
1229
+ Some ( crate :: hashed_uri:: HashedUri :: new (
1230
+ signature_uri,
1231
+ Some ( ingredient_active_claim. alg ( ) . to_owned ( ) ) ,
1232
+ sig_hash. as_ref ( ) ,
1233
+ ) ) ,
1234
+ )
1229
1235
} else {
1230
- None
1236
+ ( None , None )
1231
1237
}
1232
1238
}
1233
- None => None ,
1239
+ None => ( None , None ) ,
1234
1240
}
1235
1241
}
1236
- None => None ,
1242
+ None => ( None , None ) ,
1237
1243
} ;
1238
1244
1239
1245
// if the ingredient defines a thumbnail, add it to the claim
@@ -1321,13 +1327,14 @@ impl Ingredient {
1321
1327
match claim. version ( ) {
1322
1328
1 => {
1323
1329
ingredient_assertion. document_id = self . document_id . clone ( ) ;
1324
- ingredient_assertion. c2pa_manifest = c2pa_manifest ;
1330
+ ingredient_assertion. c2pa_manifest = active_manifest ;
1325
1331
ingredient_assertion
1326
1332
. validation_status
1327
1333
. clone_from ( & self . validation_status ) ;
1328
1334
}
1329
1335
2 => {
1330
- ingredient_assertion. active_manifest = c2pa_manifest;
1336
+ ingredient_assertion. active_manifest = active_manifest;
1337
+ ingredient_assertion. claim_signature = claim_signature;
1331
1338
ingredient_assertion. validation_results = self . validation_results . clone ( ) ;
1332
1339
}
1333
1340
_ => { }
0 commit comments