| 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> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 namespace net { | 39 namespace net { |
| 40 namespace test { | 40 namespace test { |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 // RecordingProofVerifier accepts any certificate chain and records the common | 43 // RecordingProofVerifier accepts any certificate chain and records the common |
| 44 // name of the leaf. | 44 // name of the leaf. |
| 45 class RecordingProofVerifier : public ProofVerifier { | 45 class RecordingProofVerifier : public ProofVerifier { |
| 46 public: | 46 public: |
| 47 // ProofVerifier interface. | 47 // ProofVerifier interface. |
| 48 QuicAsyncStatus VerifyProof(const string& hostname, | 48 QuicAsyncStatus VerifyProof( |
| 49 const uint16_t port, | 49 const string& hostname, |
| 50 const string& server_config, | 50 const uint16_t port, |
| 51 QuicVersion quic_version, | 51 const string& server_config, |
| 52 StringPiece chlo_hash, | 52 QuicVersion quic_version, |
| 53 const vector<string>& certs, | 53 StringPiece chlo_hash, |
| 54 const string& cert_sct, | 54 const vector<string>& certs, |
| 55 const string& signature, | 55 const string& cert_sct, |
| 56 const ProofVerifyContext* context, | 56 const string& signature, |
| 57 string* error_details, | 57 const ProofVerifyContext* context, |
| 58 std::unique_ptr<ProofVerifyDetails>* details, | 58 string* error_details, |
| 59 ProofVerifierCallback* callback) override { | 59 std::unique_ptr<ProofVerifyDetails>* details, |
| 60 std::unique_ptr<ProofVerifierCallback> callback) override { |
| 60 common_name_.clear(); | 61 common_name_.clear(); |
| 61 if (certs.empty()) { | 62 if (certs.empty()) { |
| 62 return QUIC_FAILURE; | 63 return QUIC_FAILURE; |
| 63 } | 64 } |
| 64 | 65 |
| 65 // Convert certs to X509Certificate. | 66 // Convert certs to X509Certificate. |
| 66 vector<StringPiece> cert_pieces(certs.size()); | 67 vector<StringPiece> cert_pieces(certs.size()); |
| 67 for (unsigned i = 0; i < certs.size(); i++) { | 68 for (unsigned i = 0; i < certs.size(); i++) { |
| 68 cert_pieces[i] = StringPiece(certs[i]); | 69 cert_pieces[i] = StringPiece(certs[i]); |
| 69 } | 70 } |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 CHECK(message); | 676 CHECK(message); |
| 676 message->headers()->SetRequestVersion( | 677 message->headers()->SetRequestVersion( |
| 677 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); | 678 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); |
| 678 message->headers()->SetRequestMethod( | 679 message->headers()->SetRequestMethod( |
| 679 HTTPMessage::MethodToString(HttpConstants::GET)); | 680 HTTPMessage::MethodToString(HttpConstants::GET)); |
| 680 message->headers()->SetRequestUri(uri); | 681 message->headers()->SetRequestUri(uri); |
| 681 } | 682 } |
| 682 | 683 |
| 683 } // namespace test | 684 } // namespace test |
| 684 } // namespace net | 685 } // namespace net |
| OLD | NEW |