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/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 ~DummyEVCertsWhitelist() override {} | 42 ~DummyEVCertsWhitelist() override {} |
43 | 43 |
44 private: | 44 private: |
45 bool canned_is_valid_; | 45 bool canned_is_valid_; |
46 bool canned_contains_response_; | 46 bool canned_contains_response_; |
47 }; | 47 }; |
48 | 48 |
49 const char kGoogleAviatorLogID[] = | 49 const char kGoogleAviatorLogID[] = |
50 "\x68\xf6\x98\xf8\x1f\x64\x82\xbe\x3a\x8c\xee\xb9\x28\x1d\x4c\xfc\x71\x51" | 50 "\x68\xf6\x98\xf8\x1f\x64\x82\xbe\x3a\x8c\xee\xb9\x28\x1d\x4c\xfc\x71\x51" |
51 "\x5d\x67\x93\xd4\x44\xd1\x0a\x67\xac\xbb\x4f\x4f\xfb\xc4"; | 51 "\x5d\x67\x93\xd4\x44\xd1\x0a\x67\xac\xbb\x4f\x4f\xfb\xc4"; |
52 COMPILE_ASSERT(arraysize(kGoogleAviatorLogID) - 1 == crypto::kSHA256Length, | 52 static_assert(arraysize(kGoogleAviatorLogID) - 1 == crypto::kSHA256Length, |
53 "Incorrect log ID length."); | 53 "Incorrect log ID length."); |
54 | 54 |
55 class CertPolicyEnforcerTest : public ::testing::Test { | 55 class CertPolicyEnforcerTest : public ::testing::Test { |
56 public: | 56 public: |
57 void SetUp() override { | 57 void SetUp() override { |
58 policy_enforcer_.reset(new CertPolicyEnforcer); | 58 policy_enforcer_.reset(new CertPolicyEnforcer); |
59 | 59 |
60 std::string der_test_cert(ct::GetDerEncodedX509Cert()); | 60 std::string der_test_cert(ct::GetDerEncodedX509Cert()); |
61 chain_ = X509Certificate::CreateFromBytes(der_test_cert.data(), | 61 chain_ = X509Certificate::CreateFromBytes(der_test_cert.data(), |
62 der_test_cert.size()); | 62 der_test_cert.size()); |
63 ASSERT_TRUE(chain_.get()); | 63 ASSERT_TRUE(chain_.get()); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 ct::CTVerifyResult result; | 293 ct::CTVerifyResult result; |
294 FillResultWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 1, | 294 FillResultWithSCTsOfOrigin(ct::SignedCertificateTimestamp::SCT_EMBEDDED, 1, |
295 &result); | 295 &result); |
296 EXPECT_FALSE(policy_enforcer_->DoesConformToCTEVPolicy( | 296 EXPECT_FALSE(policy_enforcer_->DoesConformToCTEVPolicy( |
297 chain_.get(), nullptr, result, BoundNetLog())); | 297 chain_.get(), nullptr, result, BoundNetLog())); |
298 } | 298 } |
299 | 299 |
300 } // namespace | 300 } // namespace |
301 | 301 |
302 } // namespace net | 302 } // namespace net |
OLD | NEW |