@@ -576,6 +576,10 @@ impl Store {
576576 ) -> Result < Vec < u8 > > {
577577 let claim_bytes = claim. data ( ) ?;
578578
579+ // no verification of timestamp trust while signing
580+ let mut adjusted_settings = settings. clone ( ) ;
581+ adjusted_settings. verify . verify_timestamp_trust = false ;
582+
579583 let tss = if claim. version ( ) > 1 {
580584 TimeStampStorage :: V2_sigTst2_CTT
581585 } else {
@@ -587,7 +591,7 @@ impl Store {
587591 // Let the signer do all the COSE processing and return the structured COSE data.
588592 return signer. sign ( & claim_bytes) ; // do not verify remote signers (we never did)
589593 } else {
590- cose_sign ( signer, & claim_bytes, box_size, tss, settings )
594+ cose_sign ( signer, & claim_bytes, box_size, tss, & adjusted_settings )
591595 }
592596 } else {
593597 if signer. direct_cose_handling ( ) {
@@ -616,7 +620,7 @@ impl Store {
616620 & self . ctp ,
617621 None ,
618622 & mut cose_log,
619- settings ,
623+ & adjusted_settings ,
620624 )
621625 } else {
622626 verify_cose_async (
@@ -627,7 +631,7 @@ impl Store {
627631 & self . ctp ,
628632 None ,
629633 & mut cose_log,
630- settings ,
634+ & adjusted_settings ,
631635 )
632636 . await
633637 } ;
@@ -1575,7 +1579,7 @@ impl Store {
15751579
15761580 // allow the extra ingredient trust checks
15771581 // these checks are to prevent the trust spoofing
1578- let check_ingredient_trust: bool = settings. verify . check_ingredient_trust ;
1582+ let check_ingredient_trust: bool = settings. verify . verify_trust ;
15791583
15801584 // get the 1.1-1.2 box hash
15811585 let ingredient_hashes = store. get_manifest_box_hashes ( ingredient) ;
@@ -2062,18 +2066,26 @@ impl Store {
20622066
20632067 // save the valid timestamps stored in the StoreValidationInfo
20642068 // we only use valid timestamps, otherwise just ignore
2069+ let mut adjusted_settings = settings. clone ( ) ;
2070+ let original_trust_val = adjusted_settings. verify . verify_timestamp_trust ;
20652071 for ( referenced_claim, time_stamp_token) in timestamp_assertion. as_ref ( ) {
20662072 if let Some ( rc) = svi. manifest_map . get ( referenced_claim) {
2073+ if rc. version ( ) == 1 {
2074+ // no trust checks for leagacy timestamps
2075+ adjusted_settings. verify . verify_timestamp_trust = false ;
2076+ }
2077+
20672078 if let Ok ( tst_info) = verify_time_stamp (
20682079 time_stamp_token,
20692080 rc. signature_val ( ) ,
20702081 & self . ctp ,
20712082 validation_log,
2072- settings ,
2083+ & adjusted_settings ,
20732084 ) {
20742085 svi. timestamps . insert ( rc. label ( ) . to_owned ( ) , tst_info) ;
20752086 }
20762087 }
2088+ adjusted_settings. verify . verify_timestamp_trust = original_trust_val;
20772089 }
20782090 }
20792091
@@ -4276,11 +4288,19 @@ impl Store {
42764288 ) -> Result < Vec < ( String , Vec < u8 > ) > > {
42774289 let mut oscp_response_ders = Vec :: new ( ) ;
42784290
4291+ let mut adjusted_settings = settings. clone ( ) ;
4292+ let original_trust_val = adjusted_settings. verify . verify_timestamp_trust ;
4293+
42794294 for manifest_label in manifest_labels {
42804295 if let Some ( claim) = self . claims_map . get ( & manifest_label) {
42814296 let sig = claim. signature_val ( ) . clone ( ) ;
42824297 let data = claim. data ( ) ?;
42834298
4299+ // no timestamp trust checks for 1.x manifests
4300+ if claim. version ( ) == 1 {
4301+ adjusted_settings. verify . verify_timestamp_trust = false ;
4302+ }
4303+
42844304 let sign1 = parse_cose_sign1 ( & sig, & data, validation_log) ?;
42854305 let ocsp_response_der = if _sync {
42864306 fetch_and_check_ocsp_response (
@@ -4309,6 +4329,7 @@ impl Store {
43094329 oscp_response_ders. push ( ( manifest_label, ocsp_response_der) ) ;
43104330 }
43114331 }
4332+ adjusted_settings. verify . verify_timestamp_trust = original_trust_val;
43124333 }
43134334
43144335 Ok ( oscp_response_ders)
0 commit comments