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 "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "net/cert/cert_verify_result.h" | 10 #include "net/cert/cert_verify_result.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 namespace net { | 34 namespace net { |
35 namespace tools { | 35 namespace tools { |
36 namespace test { | 36 namespace test { |
37 namespace { | 37 namespace { |
38 | 38 |
39 // RecordingProofVerifier accepts any certificate chain and records the common | 39 // RecordingProofVerifier accepts any certificate chain and records the common |
40 // name of the leaf. | 40 // name of the leaf. |
41 class RecordingProofVerifier : public ProofVerifier { | 41 class RecordingProofVerifier : public ProofVerifier { |
42 public: | 42 public: |
43 // ProofVerifier interface. | 43 // ProofVerifier interface. |
44 virtual QuicAsyncStatus VerifyProof( | 44 QuicAsyncStatus VerifyProof(const string& hostname, |
45 const string& hostname, | 45 const string& server_config, |
46 const string& server_config, | 46 const vector<string>& certs, |
47 const vector<string>& certs, | 47 const string& signature, |
48 const string& signature, | 48 const ProofVerifyContext* context, |
49 const ProofVerifyContext* context, | 49 string* error_details, |
50 string* error_details, | 50 scoped_ptr<ProofVerifyDetails>* details, |
51 scoped_ptr<ProofVerifyDetails>* details, | 51 ProofVerifierCallback* callback) override { |
52 ProofVerifierCallback* callback) override { | |
53 common_name_.clear(); | 52 common_name_.clear(); |
54 if (certs.empty()) { | 53 if (certs.empty()) { |
55 return QUIC_FAILURE; | 54 return QUIC_FAILURE; |
56 } | 55 } |
57 | 56 |
58 // Convert certs to X509Certificate. | 57 // Convert certs to X509Certificate. |
59 vector<StringPiece> cert_pieces(certs.size()); | 58 vector<StringPiece> cert_pieces(certs.size()); |
60 for (unsigned i = 0; i < certs.size(); i++) { | 59 for (unsigned i = 0; i < certs.size(); i++) { |
61 cert_pieces[i] = StringPiece(certs[i]); | 60 cert_pieces[i] = StringPiece(certs[i]); |
62 } | 61 } |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 // Set policy for headers and crypto streams. | 559 // Set policy for headers and crypto streams. |
561 ReliableQuicStreamPeer::SetFecPolicy( | 560 ReliableQuicStreamPeer::SetFecPolicy( |
562 QuicSessionPeer::GetHeadersStream(client()->session()), fec_policy); | 561 QuicSessionPeer::GetHeadersStream(client()->session()), fec_policy); |
563 ReliableQuicStreamPeer::SetFecPolicy(client()->session()->GetCryptoStream(), | 562 ReliableQuicStreamPeer::SetFecPolicy(client()->session()->GetCryptoStream(), |
564 fec_policy); | 563 fec_policy); |
565 } | 564 } |
566 | 565 |
567 } // namespace test | 566 } // namespace test |
568 } // namespace tools | 567 } // namespace tools |
569 } // namespace net | 568 } // namespace net |
OLD | NEW |