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/rand_util.h" | 7 #include "base/rand_util.h" |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 const size_t kInputKeyingMaterialLength = 32; | 21 const size_t kInputKeyingMaterialLength = 32; |
22 | 22 |
23 // Used by QuicCryptoServerConfig to provide dummy proof credentials. | 23 // Used by QuicCryptoServerConfig to provide dummy proof credentials. |
24 // TODO(zhihuang): Remove when secure P2P QUIC handshake is possible. | 24 // TODO(zhihuang): Remove when secure P2P QUIC handshake is possible. |
25 class DummyProofSource : public net::ProofSource { | 25 class DummyProofSource : public net::ProofSource { |
26 public: | 26 public: |
27 DummyProofSource() {} | 27 DummyProofSource() {} |
28 ~DummyProofSource() override {} | 28 ~DummyProofSource() override {} |
29 | 29 |
30 // ProofSource override. | 30 // ProofSource override. |
31 bool GetProof(const net::QuicSocketAddress& server_addr, | 31 bool GetProof( |
32 const std::string& hostname, | 32 const net::QuicSocketAddress& server_addr, |
33 const std::string& server_config, | 33 const std::string& hostname, |
34 net::QuicVersion quic_version, | 34 const std::string& server_config, |
35 base::StringPiece chlo_hash, | 35 net::QuicVersion quic_version, |
36 const net::QuicTagVector& connection_options, | 36 base::StringPiece chlo_hash, |
37 scoped_refptr<net::ProofSource::Chain>* out_chain, | 37 const net::QuicTagVector& connection_options, |
38 net::QuicCryptoProof* proof) override { | 38 net::QuicReferenceCountedPointer<net::ProofSource::Chain>* out_chain, |
| 39 net::QuicCryptoProof* proof) override { |
39 std::vector<std::string> certs; | 40 std::vector<std::string> certs; |
40 certs.push_back("Dummy cert"); | 41 certs.push_back("Dummy cert"); |
41 *out_chain = new ProofSource::Chain(certs); | 42 *out_chain = new ProofSource::Chain(certs); |
42 proof->signature = "Dummy signature"; | 43 proof->signature = "Dummy signature"; |
43 proof->leaf_cert_scts = "Dummy timestamp"; | 44 proof->leaf_cert_scts = "Dummy timestamp"; |
44 return true; | 45 return true; |
45 } | 46 } |
46 | 47 |
47 void GetProof(const net::QuicSocketAddress& server_addr, | 48 void GetProof(const net::QuicSocketAddress& server_addr, |
48 const std::string& hostname, | 49 const std::string& hostname, |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 ActivateStream(std::unique_ptr<QuicStream>(stream)); | 283 ActivateStream(std::unique_ptr<QuicStream>(stream)); |
283 // Register the stream to the QuicWriteBlockedList. |priority| is clamped | 284 // Register the stream to the QuicWriteBlockedList. |priority| is clamped |
284 // between 0 and 7, with 0 being the highest priority and 7 the lowest | 285 // between 0 and 7, with 0 being the highest priority and 7 the lowest |
285 // priority. | 286 // priority. |
286 write_blocked_streams()->RegisterStream(stream->id(), priority); | 287 write_blocked_streams()->RegisterStream(stream->id(), priority); |
287 } | 288 } |
288 return stream; | 289 return stream; |
289 } | 290 } |
290 | 291 |
291 } // namespace net | 292 } // namespace net |
OLD | NEW |