| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // and establish an insecure QUIC connection. | 97 // and establish an insecure QUIC connection. |
| 98 // TODO(mikescarlett): Remove when secure P2P QUIC handshake is possible. | 98 // TODO(mikescarlett): Remove when secure P2P QUIC handshake is possible. |
| 99 class InsecureProofVerifier : public net::ProofVerifier { | 99 class InsecureProofVerifier : public net::ProofVerifier { |
| 100 public: | 100 public: |
| 101 InsecureProofVerifier() {} | 101 InsecureProofVerifier() {} |
| 102 ~InsecureProofVerifier() override {} | 102 ~InsecureProofVerifier() override {} |
| 103 | 103 |
| 104 // ProofVerifier override. | 104 // ProofVerifier override. |
| 105 net::QuicAsyncStatus VerifyProof( | 105 net::QuicAsyncStatus VerifyProof( |
| 106 const std::string& hostname, | 106 const std::string& hostname, |
| 107 const uint16_t port, |
| 107 const std::string& server_config, | 108 const std::string& server_config, |
| 109 net::QuicVersion quic_version, |
| 110 base::StringPiece chlo_hash, |
| 108 const std::vector<std::string>& certs, | 111 const std::vector<std::string>& certs, |
| 109 const std::string& cert_sct, | 112 const std::string& cert_sct, |
| 110 const std::string& signature, | 113 const std::string& signature, |
| 111 const net::ProofVerifyContext* verify_context, | 114 const net::ProofVerifyContext* context, |
| 112 std::string* error_details, | 115 std::string* error_details, |
| 113 std::unique_ptr<net::ProofVerifyDetails>* verify_details, | 116 std::unique_ptr<net::ProofVerifyDetails>* verify_details, |
| 114 net::ProofVerifierCallback* callback) override { | 117 net::ProofVerifierCallback* callback) override { |
| 115 LOG(LS_INFO) << "VerifyProof() ignoring credentials and returning success"; | 118 LOG(LS_INFO) << "VerifyProof() ignoring credentials and returning success"; |
| 116 return net::QUIC_SUCCESS; | 119 return net::QUIC_SUCCESS; |
| 117 } | 120 } |
| 118 }; | 121 }; |
| 119 | 122 |
| 120 } // namespace | 123 } // namespace |
| 121 | 124 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 << "Error generating input keying material for HKDF."; | 481 << "Error generating input keying material for HKDF."; |
| 479 return false; | 482 return false; |
| 480 } | 483 } |
| 481 quic_crypto_server_config_.reset(new net::QuicCryptoServerConfig( | 484 quic_crypto_server_config_.reset(new net::QuicCryptoServerConfig( |
| 482 source_address_token_secret, helper_.GetRandomGenerator(), | 485 source_address_token_secret, helper_.GetRandomGenerator(), |
| 483 proof_source)); | 486 proof_source)); |
| 484 // Provide server with serialized config string to prove ownership. | 487 // Provide server with serialized config string to prove ownership. |
| 485 net::QuicCryptoServerConfig::ConfigOptions options; | 488 net::QuicCryptoServerConfig::ConfigOptions options; |
| 486 quic_crypto_server_config_->AddDefaultConfig(helper_.GetRandomGenerator(), | 489 quic_crypto_server_config_->AddDefaultConfig(helper_.GetRandomGenerator(), |
| 487 helper_.GetClock(), options); | 490 helper_.GetClock(), options); |
| 491 quic_compressed_certs_cache_.reset(new net::QuicCompressedCertsCache( |
| 492 net::QuicCompressedCertsCache::kQuicCompressedCertsCacheSize)); |
| 493 // TODO(mikescarlett): Add support for stateless rejects. |
| 494 bool use_stateless_rejects_if_peer_supported = false; |
| 488 net::QuicCryptoServerStream* crypto_stream = | 495 net::QuicCryptoServerStream* crypto_stream = |
| 489 new net::QuicCryptoServerStream(quic_crypto_server_config_.get(), | 496 new net::QuicCryptoServerStream(quic_crypto_server_config_.get(), |
| 497 quic_compressed_certs_cache_.get(), |
| 498 use_stateless_rejects_if_peer_supported, |
| 490 quic_.get()); | 499 quic_.get()); |
| 491 quic_->StartServerHandshake(crypto_stream); | 500 quic_->StartServerHandshake(crypto_stream); |
| 492 LOG_J(LS_INFO, this) << "QuicTransportChannel: Started server handshake."; | 501 LOG_J(LS_INFO, this) << "QuicTransportChannel: Started server handshake."; |
| 493 } | 502 } |
| 494 return true; | 503 return true; |
| 495 } | 504 } |
| 496 | 505 |
| 497 bool QuicTransportChannel::HandleQuicPacket(const char* data, size_t size) { | 506 bool QuicTransportChannel::HandleQuicPacket(const char* data, size_t size) { |
| 498 ASSERT(rtc::Thread::Current() == worker_thread_); | 507 ASSERT(rtc::Thread::Current() == worker_thread_); |
| 499 return quic_->OnReadPacket(data, size); | 508 return quic_->OnReadPacket(data, size); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 return quic_->CreateOutgoingDynamicStream(priority); | 587 return quic_->CreateOutgoingDynamicStream(priority); |
| 579 } | 588 } |
| 580 return nullptr; | 589 return nullptr; |
| 581 } | 590 } |
| 582 | 591 |
| 583 void QuicTransportChannel::OnIncomingStream(ReliableQuicStream* stream) { | 592 void QuicTransportChannel::OnIncomingStream(ReliableQuicStream* stream) { |
| 584 SignalIncomingStream(stream); | 593 SignalIncomingStream(stream); |
| 585 } | 594 } |
| 586 | 595 |
| 587 } // namespace cricket | 596 } // namespace cricket |
| OLD | NEW |