| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/multi_log_ct_verifier.h" | 5 #include "net/cert/multi_log_ct_verifier.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 der_test_cert.length()); | 66 der_test_cert.length()); |
| 67 ASSERT_TRUE(chain_.get()); | 67 ASSERT_TRUE(chain_.get()); |
| 68 | 68 |
| 69 embedded_sct_chain_ = | 69 embedded_sct_chain_ = |
| 70 CreateCertificateChainFromFile(GetTestCertsDirectory(), | 70 CreateCertificateChainFromFile(GetTestCertsDirectory(), |
| 71 "ct-test-embedded-cert.pem", | 71 "ct-test-embedded-cert.pem", |
| 72 X509Certificate::FORMAT_AUTO); | 72 X509Certificate::FORMAT_AUTO); |
| 73 ASSERT_TRUE(embedded_sct_chain_.get()); | 73 ASSERT_TRUE(embedded_sct_chain_.get()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 bool CheckForEmbeddedSCTInNetLog(TestNetLog& net_log) { | 76 bool CheckForEmbeddedSCTInNetLog(const TestNetLog& net_log) { |
| 77 TestNetLogEntry::List entries; | 77 TestNetLogEntry::List entries; |
| 78 net_log.GetEntries(&entries); | 78 net_log.GetEntries(&entries); |
| 79 if (entries.size() != 2) | 79 if (entries.size() != 2) |
| 80 return false; | 80 return false; |
| 81 | 81 |
| 82 const TestNetLogEntry& received = entries[0]; | 82 const TestNetLogEntry& received = entries[0]; |
| 83 std::string embedded_scts; | 83 std::string embedded_scts; |
| 84 if (!received.GetStringValue("embedded_scts", &embedded_scts)) | 84 if (!received.GetStringValue("embedded_scts", &embedded_scts)) |
| 85 return false; | 85 return false; |
| 86 if (embedded_scts.empty()) | 86 if (embedded_scts.empty()) |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 Mock::VerifyAndClearExpectations(&observer); | 286 Mock::VerifyAndClearExpectations(&observer); |
| 287 | 287 |
| 288 EXPECT_CALL(observer, OnSCTVerified(embedded_sct_chain_.get(), _)).Times(0); | 288 EXPECT_CALL(observer, OnSCTVerified(embedded_sct_chain_.get(), _)).Times(0); |
| 289 verifier_->SetObserver(nullptr); | 289 verifier_->SetObserver(nullptr); |
| 290 ASSERT_TRUE(VerifySinglePrecertificateChain(embedded_sct_chain_)); | 290 ASSERT_TRUE(VerifySinglePrecertificateChain(embedded_sct_chain_)); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace | 293 } // namespace |
| 294 | 294 |
| 295 } // namespace net | 295 } // namespace net |
| OLD | NEW |