| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tools/quic/test_tools/quic_test_client.h" | 5 #include "net/tools/quic/test_tools/quic_test_client.h" |
| 6 | 6 |
| 7 #include <memory> |
| 8 |
| 7 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 8 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
| 9 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
| 10 #include "net/cert/cert_verify_result.h" | 12 #include "net/cert/cert_verify_result.h" |
| 11 #include "net/cert/x509_certificate.h" | 13 #include "net/cert/x509_certificate.h" |
| 12 #include "net/quic/crypto/proof_verifier.h" | 14 #include "net/quic/crypto/proof_verifier.h" |
| 13 #include "net/quic/quic_flags.h" | 15 #include "net/quic/quic_flags.h" |
| 14 #include "net/quic/quic_server_id.h" | 16 #include "net/quic/quic_server_id.h" |
| 15 #include "net/quic/test_tools/quic_connection_peer.h" | 17 #include "net/quic/test_tools/quic_connection_peer.h" |
| 16 #include "net/quic/test_tools/quic_spdy_session_peer.h" | 18 #include "net/quic/test_tools/quic_spdy_session_peer.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 35 | 37 |
| 36 namespace net { | 38 namespace net { |
| 37 namespace test { | 39 namespace test { |
| 38 namespace { | 40 namespace { |
| 39 | 41 |
| 40 // RecordingProofVerifier accepts any certificate chain and records the common | 42 // RecordingProofVerifier accepts any certificate chain and records the common |
| 41 // name of the leaf. | 43 // name of the leaf. |
| 42 class RecordingProofVerifier : public ProofVerifier { | 44 class RecordingProofVerifier : public ProofVerifier { |
| 43 public: | 45 public: |
| 44 // ProofVerifier interface. | 46 // ProofVerifier interface. |
| 45 QuicAsyncStatus VerifyProof(const string& hostname, | 47 QuicAsyncStatus VerifyProof(const string& hostname, const uint16_t port, |
| 46 const uint16_t port, | |
| 47 const string& server_config, | 48 const string& server_config, |
| 48 QuicVersion quic_version, | 49 QuicVersion quic_version, StringPiece chlo_hash, |
| 49 StringPiece chlo_hash, | |
| 50 const vector<string>& certs, | 50 const vector<string>& certs, |
| 51 const string& cert_sct, | 51 const string& cert_sct, const string& signature, |
| 52 const string& signature, | |
| 53 const ProofVerifyContext* context, | 52 const ProofVerifyContext* context, |
| 54 string* error_details, | 53 string* error_details, |
| 55 std::unique_ptr<ProofVerifyDetails>* details, | 54 std::unique_ptr<ProofVerifyDetails>* details, |
| 56 ProofVerifierCallback* callback) override { | 55 ProofVerifierCallback* callback) override { |
| 57 common_name_.clear(); | 56 common_name_.clear(); |
| 58 if (certs.empty()) { | 57 if (certs.empty()) { |
| 59 return QUIC_FAILURE; | 58 return QUIC_FAILURE; |
| 60 } | 59 } |
| 61 | 60 |
| 62 // Convert certs to X509Certificate. | 61 // Convert certs to X509Certificate. |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 CHECK(message); | 666 CHECK(message); |
| 668 message->headers()->SetRequestVersion( | 667 message->headers()->SetRequestVersion( |
| 669 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); | 668 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); |
| 670 message->headers()->SetRequestMethod( | 669 message->headers()->SetRequestMethod( |
| 671 HTTPMessage::MethodToString(HttpConstants::GET)); | 670 HTTPMessage::MethodToString(HttpConstants::GET)); |
| 672 message->headers()->SetRequestUri(uri); | 671 message->headers()->SetRequestUri(uri); |
| 673 } | 672 } |
| 674 | 673 |
| 675 } // namespace test | 674 } // namespace test |
| 676 } // namespace net | 675 } // namespace net |
| OLD | NEW |