OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/quartc/quartc_session.h" | 5 #include "net/quic/quartc/quartc_session.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class FakeProofSource : public net::ProofSource { | 49 class FakeProofSource : public net::ProofSource { |
50 public: | 50 public: |
51 explicit FakeProofSource(bool success) : success_(success) {} | 51 explicit FakeProofSource(bool success) : success_(success) {} |
52 | 52 |
53 // ProofSource override. | 53 // ProofSource override. |
54 bool GetProof(const IPAddress& server_ip, | 54 bool GetProof(const IPAddress& server_ip, |
55 const std::string& hostname, | 55 const std::string& hostname, |
56 const std::string& server_config, | 56 const std::string& server_config, |
57 net::QuicVersion quic_version, | 57 net::QuicVersion quic_version, |
58 base::StringPiece chlo_hash, | 58 base::StringPiece chlo_hash, |
| 59 const net::QuicTagVector& connection_options, |
59 scoped_refptr<net::ProofSource::Chain>* out_certs, | 60 scoped_refptr<net::ProofSource::Chain>* out_certs, |
60 std::string* out_signature, | 61 std::string* out_signature, |
61 std::string* out_leaf_cert_sct) override { | 62 std::string* out_leaf_cert_sct) override { |
62 if (success_) { | 63 if (success_) { |
63 std::vector<std::string> certs; | 64 std::vector<std::string> certs; |
64 certs.push_back("Required to establish handshake"); | 65 certs.push_back("Required to establish handshake"); |
65 *out_certs = new ProofSource::Chain(certs); | 66 *out_certs = new ProofSource::Chain(certs); |
66 *out_signature = "Signature"; | 67 *out_signature = "Signature"; |
67 *out_leaf_cert_sct = "Time"; | 68 *out_leaf_cert_sct = "Time"; |
68 } | 69 } |
69 return success_; | 70 return success_; |
70 } | 71 } |
71 | 72 |
72 void GetProof(const net::IPAddress& server_ip, | 73 void GetProof(const net::IPAddress& server_ip, |
73 const std::string& hostname, | 74 const std::string& hostname, |
74 const std::string& server_config, | 75 const std::string& server_config, |
75 net::QuicVersion quic_version, | 76 net::QuicVersion quic_version, |
76 base::StringPiece chlo_hash, | 77 base::StringPiece chlo_hash, |
| 78 const net::QuicTagVector& connection_options, |
77 std::unique_ptr<Callback> callback) override { | 79 std::unique_ptr<Callback> callback) override { |
78 LOG(INFO) << "GetProof() providing dummy credentials for insecure QUIC"; | 80 LOG(INFO) << "GetProof() providing dummy credentials for insecure QUIC"; |
79 } | 81 } |
80 | 82 |
81 private: | 83 private: |
82 // Whether or not obtaining proof source succeeds. | 84 // Whether or not obtaining proof source succeeds. |
83 bool success_; | 85 bool success_; |
84 }; | 86 }; |
85 | 87 |
86 // Used by QuicCryptoClientConfig to verify server credentials, returning a | 88 // Used by QuicCryptoClientConfig to verify server credentials, returning a |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 EXPECT_FALSE(client_peer_->IsClosedStream(id)); | 500 EXPECT_FALSE(client_peer_->IsClosedStream(id)); |
499 stream->SetDelegate(client_peer_->stream_delegate()); | 501 stream->SetDelegate(client_peer_->stream_delegate()); |
500 stream->Close(); | 502 stream->Close(); |
501 RunLoopWithTimeout(); | 503 RunLoopWithTimeout(); |
502 EXPECT_TRUE(client_peer_->IsClosedStream(id)); | 504 EXPECT_TRUE(client_peer_->IsClosedStream(id)); |
503 } | 505 } |
504 | 506 |
505 } // namespace | 507 } // namespace |
506 } // namespace test | 508 } // namespace test |
507 } // namespace net | 509 } // namespace net |
OLD | NEW |