| 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 TEST_F(CTPolicyEnforcerTest, ConformsToCTEVPolicyIfSCTBeforeEnforcementDate) { | 174 #if defined(OS_ANDROID) |
| 175 #define MAYBE_ConformsToCTEVPolicyIfSCTBeforeEnforcementDate |
| 176 DISABLED_ConformsToCTEVPolicyIfSCTBeforeEnforcementDate |
| 177 #else |
| 178 #define MAYBE_ConformsToCTEVPolicyIfSCTBeforeEnforcementDate \ |
| 179 ConformsToCTEVPolicyIfSCTBeforeEnforcementDate |
| 180 #endif |
| 181 TEST_F(CTPolicyEnforcerTest, |
| 182 MAYBE_ConformsToCTEVPolicyIfSCTBeforeEnforcementDate) { |
| 175 ct::SCTList scts; | 183 ct::SCTList scts; |
| 176 // |chain_| is valid for 10 years - over 121 months - so requires 5 SCTs. | 184 // |chain_| is valid for 10 years - over 121 months - so requires 5 SCTs. |
| 177 // All 5 SCTs will be from non-Google logs. | 185 // All 5 SCTs will be from non-Google logs. |
| 178 FillListWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 5, | 186 FillListWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 5, |
| 179 std::vector<std::string>(), false, &scts); | 187 std::vector<std::string>(), false, &scts); |
| 180 | 188 |
| 181 EXPECT_EQ(ct::CertPolicyCompliance::CERT_POLICY_COMPLIES_VIA_SCTS, | 189 EXPECT_EQ(ct::CertPolicyCompliance::CERT_POLICY_COMPLIES_VIA_SCTS, |
| 182 policy_enforcer_->DoesConformToCertPolicy(chain_.get(), scts, | 190 policy_enforcer_->DoesConformToCertPolicy(chain_.get(), scts, |
| 183 NetLogWithSource())); | 191 NetLogWithSource())); |
| 184 EXPECT_EQ(ct::EVPolicyCompliance::EV_POLICY_COMPLIES_VIA_SCTS, | 192 EXPECT_EQ(ct::EVPolicyCompliance::EV_POLICY_COMPLIES_VIA_SCTS, |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 FillListWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 2, | 570 FillListWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 2, |
| 563 &scts); | 571 &scts); |
| 564 EXPECT_EQ(ct::EVPolicyCompliance::EV_POLICY_NOT_ENOUGH_SCTS, | 572 EXPECT_EQ(ct::EVPolicyCompliance::EV_POLICY_NOT_ENOUGH_SCTS, |
| 565 policy_enforcer_->DoesConformToCTEVPolicy( | 573 policy_enforcer_->DoesConformToCTEVPolicy( |
| 566 chain_.get(), nullptr, scts, NetLogWithSource())); | 574 chain_.get(), nullptr, scts, NetLogWithSource())); |
| 567 } | 575 } |
| 568 | 576 |
| 569 } // namespace | 577 } // namespace |
| 570 | 578 |
| 571 } // namespace net | 579 } // namespace net |
| OLD | NEW |