@@ -248,7 +248,6 @@ impl SecurityState {
248
248
) ) ,
249
249
None => Ok ( ( ) ) ,
250
250
} ?;
251
- self . load_bundled_intermediates ( ) ?;
252
251
self . load_crlite_filter ( ) ?;
253
252
Ok ( ( ) )
254
253
}
@@ -593,30 +592,21 @@ impl SecurityState {
593
592
// If an adversary can find two different certificates with the same sha-256 hash, they can
594
593
// probably forge a sha-256-based signature, so assuming the keys we create here are unique is
595
594
// not a security issue.
596
- //
597
- // When the to-be-added certs come from remote settings, the caller should set the
598
- // `set_has_prior_data_flag` argument to `true`. The prior data flag is used by the remote
599
- // settings client as a data loss canary: if the remote settings client finds that the flag
600
- // is not set it will re-ingest the entire intermediate certs collection.
601
- fn add_certs_internal (
595
+ pub fn add_certs (
602
596
& mut self ,
603
597
certs : & [ ( nsCString , nsCString , i16 ) ] ,
604
- set_has_prior_data_flag : bool ,
605
598
) -> Result < ( ) , SecurityStateError > {
606
599
let env_and_store = match self . env_and_store . as_mut ( ) {
607
600
Some ( env_and_store) => env_and_store,
608
601
None => return Err ( SecurityStateError :: from ( "env and store not initialized?" ) ) ,
609
602
} ;
610
603
let mut writer = env_and_store. env . write ( ) ?;
611
-
612
- if set_has_prior_data_flag {
613
- // Make a note that we have prior cert data now.
614
- env_and_store. store . put (
615
- & mut writer,
616
- & make_key ! ( PREFIX_DATA_TYPE , & [ nsICertStorage:: DATA_TYPE_CERTIFICATE ] ) ,
617
- & Value :: Bool ( true ) ,
618
- ) ?;
619
- }
604
+ // Make a note that we have prior cert data now.
605
+ env_and_store. store . put (
606
+ & mut writer,
607
+ & make_key ! ( PREFIX_DATA_TYPE , & [ nsICertStorage:: DATA_TYPE_CERTIFICATE ] ) ,
608
+ & Value :: Bool ( true ) ,
609
+ ) ?;
620
610
621
611
for ( cert_der_base64, subject_base64, trust) in certs {
622
612
let cert_der = match BASE64_STANDARD . decode ( & cert_der_base64) {
@@ -662,46 +652,6 @@ impl SecurityState {
662
652
Ok ( ( ) )
663
653
}
664
654
665
- pub fn add_certs (
666
- & mut self ,
667
- certs : & [ ( nsCString , nsCString , i16 ) ] ,
668
- ) -> Result < ( ) , SecurityStateError > {
669
- self . add_certs_internal ( certs, /* set_has_prior_data_flag */ true )
670
- }
671
-
672
- fn load_bundled_intermediates ( & mut self ) -> Result < ( ) , SecurityStateError > {
673
- let bundled_intermediates = [ (
674
- // Bug 1966632: the "SSL.com TLS Transit ECC CA R2" intermediate issued by "SSL.com TLS ECC Root CA 2022"
675
- "MIIDNDCCArmgAwIBAgIQYE2K+NALqHSLlVhTFyxfLjAKBggqhkjOPQQDAzBOMQsw\
676
- CQYDVQQGEwJVUzEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMSUwIwYDVQQDDBxT\
677
- U0wuY29tIFRMUyBFQ0MgUm9vdCBDQSAyMDIyMB4XDTIyMTAyMTE3MDIyM1oXDTM3\
678
- MTAxNzE3MDIyMlowTzELMAkGA1UEBhMCVVMxGDAWBgNVBAoMD1NTTCBDb3Jwb3Jh\
679
- dGlvbjEmMCQGA1UEAwwdU1NMLmNvbSBUTFMgVHJhbnNpdCBFQ0MgQ0EgUjIwdjAQ\
680
- BgcqhkjOPQIBBgUrgQQAIgNiAARk532ZA1NckR7q+NgjraG/LOJjie8oaPbt1/Ds\
681
- q2iudyvkdpcbUOvbWSgtb7g2uauNl8pMIp7uidkCP/16czqQjSvMLzo3g9oNtC1F\
682
- G3NyCWVfeCE954tmP0f9CSnWFA+jggFZMIIBVTASBgNVHRMBAf8ECDAGAQH/AgEB\
683
- MB8GA1UdIwQYMBaAFImPL6PoK6AUVHvzVrgmX2c4C5zQMEwGCCsGAQUFBwEBBEAw\
684
- PjA8BggrBgEFBQcwAoYwaHR0cDovL2NlcnQuc3NsLmNvbS9TU0xjb20tVExTLVJv\
685
- b3QtMjAyMi1FQ0MuY2VyMD8GA1UdIAQ4MDYwNAYEVR0gADAsMCoGCCsGAQUFBwIB\
686
- Fh5odHRwczovL3d3dy5zc2wuY29tL3JlcG9zaXRvcnkwHQYDVR0lBBYwFAYIKwYB\
687
- BQUHAwIGCCsGAQUFBwMBMEEGA1UdHwQ6MDgwNqA0oDKGMGh0dHA6Ly9jcmxzLnNz\
688
- bC5jb20vU1NMY29tLVRMUy1Sb290LTIwMjItRUNDLmNybDAdBgNVHQ4EFgQUMqLH\
689
- 2FiL/3/APPJVaTPszswfvJcwDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMDA2kA\
690
- MGYCMQC4SkI+e2cts1nTN9MCRil97z624WxLAp94hT7tNZGPZLe9YiLIyzgKqW/b\
691
- E0b2h9ACMQCvV5XMRcunAylQaCQc4J/GwR1p7yrPC0DRWWeyLAkQWi5Ylta9DxlX\
692
- 74QFFksFCP0="
693
- . into ( ) ,
694
- "ME8xCzAJBgNVBAYTAlVTMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xJjAkBgNV\
695
- BAMMHVNTTC5jb20gVExTIFRyYW5zaXQgRUNDIENBIFIy"
696
- . into ( ) ,
697
- nsICertStorage:: TRUST_INHERIT ,
698
- ) ] ;
699
- self . add_certs_internal (
700
- & bundled_intermediates,
701
- /* set_has_prior_data_flag */ false ,
702
- )
703
- }
704
-
705
655
// Given a list of certificate sha-256 hashes, we can look up each Cert entry in the database.
706
656
// We use this to find the corresponding subject so we can look up the CertHashList it should
707
657
// appear in. If that list contains the given hash, we remove it and update the CertHashList.
0 commit comments