Chromium Code Reviews| 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/quic/test_tools/crypto_test_utils.h" | 5 #include "net/quic/test_tools/crypto_test_utils.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "net/base/test_data_directory.h" | 9 #include "net/base/test_data_directory.h" |
| 10 #include "net/cert/cert_verifier.h" | 10 #include "net/cert/cert_verifier.h" |
| 11 #include "net/cert/test_root_certs.h" | 11 #include "net/cert/test_root_certs.h" |
| 12 #include "net/cert/x509_certificate.h" | 12 #include "net/cert/x509_certificate.h" |
| 13 #include "net/http/transport_security_state.h" | 13 #include "net/http/transport_security_state.h" |
| 14 #include "net/quic/crypto/proof_source_chromium.h" | 14 #include "net/quic/crypto/proof_source_chromium.h" |
| 15 #include "net/quic/crypto/proof_verifier_chromium.h" | 15 #include "net/quic/crypto/proof_verifier_chromium.h" |
| 16 #include "net/test/cert_test_util.h" | 16 #include "net/test/cert_test_util.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 namespace test { | 20 namespace test { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 class TestProofVerifierChromium : public ProofVerifierChromium { | 24 class TestProofVerifierChromium : public ProofVerifierChromium { |
| 25 public: | 25 public: |
| 26 TestProofVerifierChromium(CertVerifier* cert_verifier, | 26 TestProofVerifierChromium(scoped_ptr<CertVerifier> cert_verifier, |
| 27 TransportSecurityState* transport_security_state, | 27 TransportSecurityState* transport_security_state, |
|
pauljensen
2015/08/28 13:38:02
would be nice to make this a scoped_ptr
Randy Smith (Not in Mondays)
2015/09/02 23:42:19
Done.
| |
| 28 const std::string& cert_file) | 28 const std::string& cert_file) |
| 29 : ProofVerifierChromium(cert_verifier, nullptr, transport_security_state), | 29 : ProofVerifierChromium(cert_verifier.get(), |
| 30 cert_verifier_(cert_verifier), | 30 nullptr, |
| 31 transport_security_state), | |
| 32 cert_verifier_(cert_verifier.Pass()), | |
| 31 transport_security_state_(transport_security_state) { | 33 transport_security_state_(transport_security_state) { |
| 32 // Load and install the root for the validated chain. | 34 // Load and install the root for the validated chain. |
| 33 scoped_refptr<X509Certificate> root_cert = | 35 scoped_refptr<X509Certificate> root_cert = |
| 34 ImportCertFromFile(GetTestCertsDirectory(), cert_file); | 36 ImportCertFromFile(GetTestCertsDirectory(), cert_file); |
| 35 scoped_root_.Reset(root_cert.get()); | 37 scoped_root_.Reset(root_cert.get()); |
| 36 } | 38 } |
| 37 ~TestProofVerifierChromium() override {} | 39 ~TestProofVerifierChromium() override {} |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 ScopedTestRoot scoped_root_; | 42 ScopedTestRoot scoped_root_; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 } | 137 } |
| 136 | 138 |
| 137 // static | 139 // static |
| 138 ProofVerifyContext* CryptoTestUtils::FakeProofVerifyContextForTesting() { | 140 ProofVerifyContext* CryptoTestUtils::FakeProofVerifyContextForTesting() { |
| 139 return nullptr; | 141 return nullptr; |
| 140 } | 142 } |
| 141 | 143 |
| 142 } // namespace test | 144 } // namespace test |
| 143 | 145 |
| 144 } // namespace net | 146 } // namespace net |
| OLD | NEW |