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/cert_policy_enforcer.h" | 5 #include "net/cert/cert_policy_enforcer.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 protected: | 39 protected: |
40 ~DummyEVCertsWhitelist() override {} | 40 ~DummyEVCertsWhitelist() override {} |
41 | 41 |
42 private: | 42 private: |
43 bool canned_is_valid_; | 43 bool canned_is_valid_; |
44 bool canned_contains_response_; | 44 bool canned_contains_response_; |
45 }; | 45 }; |
46 | 46 |
47 class CertPolicyEnforcerTest : public ::testing::Test { | 47 class CertPolicyEnforcerTest : public ::testing::Test { |
48 public: | 48 public: |
49 virtual void SetUp() override { | 49 void SetUp() override { |
50 policy_enforcer_.reset(new CertPolicyEnforcer(true)); | 50 policy_enforcer_.reset(new CertPolicyEnforcer(true)); |
51 | 51 |
52 std::string der_test_cert(ct::GetDerEncodedX509Cert()); | 52 std::string der_test_cert(ct::GetDerEncodedX509Cert()); |
53 chain_ = X509Certificate::CreateFromBytes(der_test_cert.data(), | 53 chain_ = X509Certificate::CreateFromBytes(der_test_cert.data(), |
54 der_test_cert.size()); | 54 der_test_cert.size()); |
55 ASSERT_TRUE(chain_.get()); | 55 ASSERT_TRUE(chain_.get()); |
56 } | 56 } |
57 | 57 |
58 void FillResultWithSCTsOfOrigin( | 58 void FillResultWithSCTsOfOrigin( |
59 ct::SignedCertificateTimestamp::Origin desired_origin, | 59 ct::SignedCertificateTimestamp::Origin desired_origin, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 ct::CTVerifyResult result; | 194 ct::CTVerifyResult result; |
195 FillResultWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 1, | 195 FillResultWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 1, |
196 &result); | 196 &result); |
197 EXPECT_FALSE(policy_enforcer_->DoesConformToCTEVPolicy( | 197 EXPECT_FALSE(policy_enforcer_->DoesConformToCTEVPolicy( |
198 chain_.get(), nullptr, result, BoundNetLog())); | 198 chain_.get(), nullptr, result, BoundNetLog())); |
199 } | 199 } |
200 | 200 |
201 } // namespace | 201 } // namespace |
202 | 202 |
203 } // namespace net | 203 } // namespace net |
OLD | NEW |