| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/cert/ct_policy_enforcer.h" | 5 #include "net/cert/ct_policy_enforcer.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 desired_log_ids.size(), desired_log_ids, true, &scts); | 164 desired_log_ids.size(), desired_log_ids, true, &scts); |
| 165 | 165 |
| 166 EXPECT_EQ(ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS, | 166 EXPECT_EQ(ct::CertPolicyCompliance::CERT_POLICY_NOT_DIVERSE_SCTS, |
| 167 policy_enforcer_->DoesConformToCertPolicy(chain_.get(), scts, | 167 policy_enforcer_->DoesConformToCertPolicy(chain_.get(), scts, |
| 168 NetLogWithSource())); | 168 NetLogWithSource())); |
| 169 EXPECT_EQ(ct::EVPolicyCompliance::EV_POLICY_NOT_DIVERSE_SCTS, | 169 EXPECT_EQ(ct::EVPolicyCompliance::EV_POLICY_NOT_DIVERSE_SCTS, |
| 170 policy_enforcer_->DoesConformToCTEVPolicy( | 170 policy_enforcer_->DoesConformToCTEVPolicy( |
| 171 chain_.get(), nullptr, scts, NetLogWithSource())); | 171 chain_.get(), nullptr, scts, NetLogWithSource())); |
| 172 } | 172 } |
| 173 | 173 |
| 174 #if defined(OS_ANDROID) | 174 TEST_F(CTPolicyEnforcerTest, ConformsToCTEVPolicyIfSCTBeforeEnforcementDate) { |
| 175 #define MAYBE_ConformsToCTEVPolicyIfSCTBeforeEnforcementDate | |
| 176 DISABLED_ConformsToCTEVPolicyIfSCTBeforeEnforcementDate | |
| 177 #else | |
| 178 #define MAYBE_ConformsToCTEVPolicyIfSCTBeforeEnforcementDate \ | |
| 179 ConformsToCTEVPolicyIfSCTBeforeEnforcementDate | |
| 180 #endif | |
| 181 TEST_F(CTPolicyEnforcerTest, | |
| 182 MAYBE_ConformsToCTEVPolicyIfSCTBeforeEnforcementDate) { | |
| 183 ct::SCTList scts; | 175 ct::SCTList scts; |
| 184 // |chain_| is valid for 10 years - over 121 months - so requires 5 SCTs. | 176 // |chain_| is valid for 10 years - over 121 months - so requires 5 SCTs. |
| 185 // All 5 SCTs will be from non-Google logs. | 177 // All 5 SCTs will be from non-Google logs. |
| 186 FillListWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 5, | 178 FillListWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 5, |
| 187 std::vector<std::string>(), false, &scts); | 179 std::vector<std::string>(), false, &scts); |
| 188 | 180 |
| 189 EXPECT_EQ(ct::CertPolicyCompliance::CERT_POLICY_COMPLIES_VIA_SCTS, | 181 EXPECT_EQ(ct::CertPolicyCompliance::CERT_POLICY_COMPLIES_VIA_SCTS, |
| 190 policy_enforcer_->DoesConformToCertPolicy(chain_.get(), scts, | 182 policy_enforcer_->DoesConformToCertPolicy(chain_.get(), scts, |
| 191 NetLogWithSource())); | 183 NetLogWithSource())); |
| 192 EXPECT_EQ(ct::EVPolicyCompliance::EV_POLICY_COMPLIES_VIA_SCTS, | 184 EXPECT_EQ(ct::EVPolicyCompliance::EV_POLICY_COMPLIES_VIA_SCTS, |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 FillListWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 2, | 562 FillListWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 2, |
| 571 &scts); | 563 &scts); |
| 572 EXPECT_EQ(ct::EVPolicyCompliance::EV_POLICY_NOT_ENOUGH_SCTS, | 564 EXPECT_EQ(ct::EVPolicyCompliance::EV_POLICY_NOT_ENOUGH_SCTS, |
| 573 policy_enforcer_->DoesConformToCTEVPolicy( | 565 policy_enforcer_->DoesConformToCTEVPolicy( |
| 574 chain_.get(), nullptr, scts, NetLogWithSource())); | 566 chain_.get(), nullptr, scts, NetLogWithSource())); |
| 575 } | 567 } |
| 576 | 568 |
| 577 } // namespace | 569 } // namespace |
| 578 | 570 |
| 579 } // namespace net | 571 } // namespace net |
| OLD | NEW |