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
3 // found in the LICENSE file.
5 #include "net/quic/quic_crypto_client_stream.h"
7 #include "base/metrics/histogram.h"
8 #include "base/profiler/scoped_tracker.h"
9 #include "net/quic/crypto/crypto_protocol.h"
10 #include "net/quic/crypto/crypto_utils.h"
11 #include "net/quic/crypto/null_encrypter.h"
12 #include "net/quic/quic_client_session_base.h"
13 #include "net/quic/quic_protocol.h"
14 #include "net/quic/quic_session.h"
20 QuicCryptoClientStream::ChannelIDSourceCallbackImpl::
21 ChannelIDSourceCallbackImpl(QuicCryptoClientStream
* stream
)
24 QuicCryptoClientStream::ChannelIDSourceCallbackImpl::
25 ~ChannelIDSourceCallbackImpl() {}
27 void QuicCryptoClientStream::ChannelIDSourceCallbackImpl::Run(
28 scoped_ptr
<ChannelIDKey
>* channel_id_key
) {
29 if (stream_
== nullptr) {
33 stream_
->channel_id_key_
.reset(channel_id_key
->release());
34 stream_
->channel_id_source_callback_run_
= true;
35 stream_
->channel_id_source_callback_
= nullptr;
36 stream_
->DoHandshakeLoop(nullptr);
38 // The ChannelIDSource owns this object and will delete it when this method
42 void QuicCryptoClientStream::ChannelIDSourceCallbackImpl::Cancel() {
46 QuicCryptoClientStream::ProofVerifierCallbackImpl::ProofVerifierCallbackImpl(
47 QuicCryptoClientStream
* stream
)
50 QuicCryptoClientStream::ProofVerifierCallbackImpl::
51 ~ProofVerifierCallbackImpl() {}
53 void QuicCryptoClientStream::ProofVerifierCallbackImpl::Run(
55 const string
& error_details
,
56 scoped_ptr
<ProofVerifyDetails
>* details
) {
57 if (stream_
== nullptr) {
61 stream_
->verify_ok_
= ok
;
62 stream_
->verify_error_details_
= error_details
;
63 stream_
->verify_details_
.reset(details
->release());
64 stream_
->proof_verify_callback_
= nullptr;
65 stream_
->DoHandshakeLoop(nullptr);
67 // The ProofVerifier owns this object and will delete it when this method
71 void QuicCryptoClientStream::ProofVerifierCallbackImpl::Cancel() {
75 QuicCryptoClientStream::QuicCryptoClientStream(
76 const QuicServerId
& server_id
,
77 QuicClientSessionBase
* session
,
78 ProofVerifyContext
* verify_context
,
79 QuicCryptoClientConfig
* crypto_config
)
80 : QuicCryptoStream(session
),
81 next_state_(STATE_IDLE
),
82 num_client_hellos_(0),
83 crypto_config_(crypto_config
),
84 server_id_(server_id
),
85 generation_counter_(0),
86 channel_id_sent_(false),
87 channel_id_source_callback_run_(false),
88 channel_id_source_callback_(nullptr),
89 verify_context_(verify_context
),
90 proof_verify_callback_(nullptr) {
91 DCHECK(!session
->connection()->is_server());
94 QuicCryptoClientStream::~QuicCryptoClientStream() {
95 if (channel_id_source_callback_
) {
96 channel_id_source_callback_
->Cancel();
98 if (proof_verify_callback_
) {
99 proof_verify_callback_
->Cancel();
103 void QuicCryptoClientStream::OnHandshakeMessage(
104 const CryptoHandshakeMessage
& message
) {
105 QuicCryptoStream::OnHandshakeMessage(message
);
107 if (message
.tag() == kSCUP
) {
108 if (!handshake_confirmed()) {
109 CloseConnection(QUIC_CRYPTO_UPDATE_BEFORE_HANDSHAKE_COMPLETE
);
113 // |message| is an update from the server, so we treat it differently from a
114 // handshake message.
115 HandleServerConfigUpdateMessage(message
);
119 // Do not process handshake messages after the handshake is confirmed.
120 if (handshake_confirmed()) {
121 CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE
);
125 DoHandshakeLoop(&message
);
128 void QuicCryptoClientStream::CryptoConnect() {
129 next_state_
= STATE_INITIALIZE
;
130 DoHandshakeLoop(nullptr);
133 int QuicCryptoClientStream::num_sent_client_hellos() const {
134 return num_client_hellos_
;
137 bool QuicCryptoClientStream::WasChannelIDSent() const {
138 return channel_id_sent_
;
141 bool QuicCryptoClientStream::WasChannelIDSourceCallbackRun() const {
142 return channel_id_source_callback_run_
;
145 void QuicCryptoClientStream::HandleServerConfigUpdateMessage(
146 const CryptoHandshakeMessage
& server_config_update
) {
147 DCHECK(server_config_update
.tag() == kSCUP
);
148 string error_details
;
149 QuicCryptoClientConfig::CachedState
* cached
=
150 crypto_config_
->LookupOrCreate(server_id_
);
151 QuicErrorCode error
= crypto_config_
->ProcessServerConfigUpdate(
152 server_config_update
,
153 session()->connection()->clock()->WallNow(),
155 &crypto_negotiated_params_
,
158 if (error
!= QUIC_NO_ERROR
) {
159 CloseConnectionWithDetails(
160 error
, "Server config update invalid: " + error_details
);
164 DCHECK(handshake_confirmed());
165 if (proof_verify_callback_
) {
166 proof_verify_callback_
->Cancel();
168 next_state_
= STATE_INITIALIZE_SCUP
;
169 DoHandshakeLoop(nullptr);
172 // kMaxClientHellos is the maximum number of times that we'll send a client
173 // hello. The value 3 accounts for:
174 // * One failure due to an incorrect or missing source-address token.
175 // * One failure due the server's certificate chain being unavailible and the
176 // server being unwilling to send it without a valid source-address token.
177 static const int kMaxClientHellos
= 3;
179 void QuicCryptoClientStream::DoHandshakeLoop(
180 const CryptoHandshakeMessage
* in
) {
181 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
182 tracked_objects::ScopedTracker
tracking_profile(
183 FROM_HERE_WITH_EXPLICIT_FUNCTION(
184 "422516 QuicCryptoClientStream::DoHandshakeLoop"));
186 QuicCryptoClientConfig::CachedState
* cached
=
187 crypto_config_
->LookupOrCreate(server_id_
);
189 QuicAsyncStatus rv
= QUIC_SUCCESS
;
191 CHECK_NE(STATE_NONE
, next_state_
);
192 const State state
= next_state_
;
193 next_state_
= STATE_IDLE
;
196 case STATE_INITIALIZE
:
197 DoInitialize(cached
);
199 case STATE_SEND_CHLO
:
200 DoSendCHLO(in
, cached
);
201 return; // return waiting to hear from server.
203 DoReceiveREJ(in
, cached
);
205 case STATE_VERIFY_PROOF
:
206 rv
= DoVerifyProof(cached
);
208 case STATE_VERIFY_PROOF_COMPLETE
:
209 DoVerifyProofComplete(cached
);
211 case STATE_GET_CHANNEL_ID
:
212 rv
= DoGetChannelID(cached
);
214 case STATE_GET_CHANNEL_ID_COMPLETE
:
215 DoGetChannelIDComplete();
217 case STATE_RECV_SHLO
:
218 DoReceiveSHLO(in
, cached
);
221 // This means that the peer sent us a message that we weren't expecting.
222 CloseConnection(QUIC_INVALID_CRYPTO_MESSAGE_TYPE
);
224 case STATE_INITIALIZE_SCUP
:
225 DoInitializeServerConfigUpdate(cached
);
229 return; // We are done.
231 } while (rv
!= QUIC_PENDING
&& next_state_
!= STATE_NONE
);
234 void QuicCryptoClientStream::DoInitialize(
235 QuicCryptoClientConfig::CachedState
* cached
) {
236 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
237 tracked_objects::ScopedTracker
tracking_profile(
238 FROM_HERE_WITH_EXPLICIT_FUNCTION(
239 "422516 QuicCryptoClientStream::DoInitialize"));
241 if (!cached
->IsEmpty() && !cached
->signature().empty() &&
242 server_id_
.is_https()) {
243 // Note that we verify the proof even if the cached proof is valid.
244 // This allows us to respond to CA trust changes or certificate
245 // expiration because it may have been a while since we last verified
247 DCHECK(crypto_config_
->proof_verifier());
248 // If the cached state needs to be verified, do it now.
249 next_state_
= STATE_VERIFY_PROOF
;
251 next_state_
= STATE_GET_CHANNEL_ID
;
255 void QuicCryptoClientStream::DoSendCHLO(
256 const CryptoHandshakeMessage
* in
,
257 QuicCryptoClientConfig::CachedState
* cached
) {
258 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
259 tracked_objects::ScopedTracker
tracking_profile1(
260 FROM_HERE_WITH_EXPLICIT_FUNCTION(
261 "422516 QuicCryptoClientStream::DoSendCHLO1"));
263 // Send the client hello in plaintext.
264 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_NONE
);
265 if (num_client_hellos_
> kMaxClientHellos
) {
266 CloseConnection(QUIC_CRYPTO_TOO_MANY_REJECTS
);
269 num_client_hellos_
++;
271 CryptoHandshakeMessage out
;
272 if (!cached
->IsComplete(session()->connection()->clock()->WallNow())) {
273 crypto_config_
->FillInchoateClientHello(
275 session()->connection()->supported_versions().front(),
276 cached
, &crypto_negotiated_params_
, &out
);
277 // Pad the inchoate client hello to fill up a packet.
278 const QuicByteCount kFramingOverhead
= 50; // A rough estimate.
279 const QuicByteCount max_packet_size
=
280 session()->connection()->max_packet_length();
281 if (max_packet_size
<= kFramingOverhead
) {
282 DLOG(DFATAL
) << "max_packet_length (" << max_packet_size
283 << ") has no room for framing overhead.";
284 CloseConnection(QUIC_INTERNAL_ERROR
);
287 if (kClientHelloMinimumSize
> max_packet_size
- kFramingOverhead
) {
288 DLOG(DFATAL
) << "Client hello won't fit in a single packet.";
289 CloseConnection(QUIC_INTERNAL_ERROR
);
292 out
.set_minimum_size(
293 static_cast<size_t>(max_packet_size
- kFramingOverhead
));
294 next_state_
= STATE_RECV_REJ
;
295 SendHandshakeMessage(out
);
299 session()->config()->ToHandshakeMessage(&out
);
300 string error_details
;
301 QuicErrorCode error
= crypto_config_
->FillClientHello(
303 session()->connection()->connection_id(),
304 session()->connection()->supported_versions().front(),
306 session()->connection()->clock()->WallNow(),
307 session()->connection()->random_generator(),
308 channel_id_key_
.get(),
309 &crypto_negotiated_params_
,
313 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
314 tracked_objects::ScopedTracker
tracking_profile2(
315 FROM_HERE_WITH_EXPLICIT_FUNCTION(
316 "422516 QuicCryptoClientStream::DoSendCHLO2"));
318 if (error
!= QUIC_NO_ERROR
) {
319 // Flush the cached config so that, if it's bad, the server has a
320 // chance to send us another in the future.
321 cached
->InvalidateServerConfig();
322 CloseConnectionWithDetails(error
, error_details
);
325 channel_id_sent_
= (channel_id_key_
.get() != nullptr);
326 if (cached
->proof_verify_details()) {
327 client_session()->OnProofVerifyDetailsAvailable(
328 *cached
->proof_verify_details());
330 next_state_
= STATE_RECV_SHLO
;
331 SendHandshakeMessage(out
);
332 // Be prepared to decrypt with the new server write key.
333 session()->connection()->SetAlternativeDecrypter(
334 crypto_negotiated_params_
.initial_crypters
.decrypter
.release(),
336 true /* latch once used */);
337 // Send subsequent packets under encryption on the assumption that the
338 // server will accept the handshake.
339 session()->connection()->SetEncrypter(
341 crypto_negotiated_params_
.initial_crypters
.encrypter
.release());
342 session()->connection()->SetDefaultEncryptionLevel(
344 if (!encryption_established_
) {
345 encryption_established_
= true;
346 session()->OnCryptoHandshakeEvent(
347 QuicSession::ENCRYPTION_FIRST_ESTABLISHED
);
349 session()->OnCryptoHandshakeEvent(
350 QuicSession::ENCRYPTION_REESTABLISHED
);
354 void QuicCryptoClientStream::DoReceiveREJ(
355 const CryptoHandshakeMessage
* in
,
356 QuicCryptoClientConfig::CachedState
* cached
) {
357 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
358 tracked_objects::ScopedTracker
tracking_profile(
359 FROM_HERE_WITH_EXPLICIT_FUNCTION(
360 "422516 QuicCryptoClientStream::DoReceiveREJ"));
362 // We sent a dummy CHLO because we didn't have enough information to
363 // perform a handshake, or we sent a full hello that the server
364 // rejected. Here we hope to have a REJ that contains the information
366 if (in
->tag() != kREJ
) {
367 next_state_
= STATE_NONE
;
368 CloseConnectionWithDetails(QUIC_INVALID_CRYPTO_MESSAGE_TYPE
,
372 string error_details
;
373 QuicErrorCode error
= crypto_config_
->ProcessRejection(
374 *in
, session()->connection()->clock()->WallNow(), cached
,
375 server_id_
.is_https(), &crypto_negotiated_params_
, &error_details
);
376 if (error
!= QUIC_NO_ERROR
) {
377 next_state_
= STATE_NONE
;
378 CloseConnectionWithDetails(error
, error_details
);
381 if (!cached
->proof_valid()) {
382 if (!server_id_
.is_https()) {
383 // We don't check the certificates for insecure QUIC connections.
384 SetCachedProofValid(cached
);
385 } else if (!cached
->signature().empty()) {
386 // Note that we only verify the proof if the cached proof is not
387 // valid. If the cached proof is valid here, someone else must have
388 // just added the server config to the cache and verified the proof,
389 // so we can assume no CA trust changes or certificate expiration
390 // has happened since then.
391 next_state_
= STATE_VERIFY_PROOF
;
395 next_state_
= STATE_GET_CHANNEL_ID
;
398 QuicAsyncStatus
QuicCryptoClientStream::DoVerifyProof(
399 QuicCryptoClientConfig::CachedState
* cached
) {
400 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
401 tracked_objects::ScopedTracker
tracking_profile(
402 FROM_HERE_WITH_EXPLICIT_FUNCTION(
403 "422516 QuicCryptoClientStream::DoVerifyProof"));
405 ProofVerifier
* verifier
= crypto_config_
->proof_verifier();
407 next_state_
= STATE_VERIFY_PROOF_COMPLETE
;
408 generation_counter_
= cached
->generation_counter();
410 ProofVerifierCallbackImpl
* proof_verify_callback
=
411 new ProofVerifierCallbackImpl(this);
415 QuicAsyncStatus status
= verifier
->VerifyProof(
417 cached
->server_config(),
420 verify_context_
.get(),
421 &verify_error_details_
,
423 proof_verify_callback
);
427 proof_verify_callback_
= proof_verify_callback
;
428 DVLOG(1) << "Doing VerifyProof";
431 delete proof_verify_callback
;
434 delete proof_verify_callback
;
441 void QuicCryptoClientStream::DoVerifyProofComplete(
442 QuicCryptoClientConfig::CachedState
* cached
) {
443 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
444 tracked_objects::ScopedTracker
tracking_profile(
445 FROM_HERE_WITH_EXPLICIT_FUNCTION(
446 "422516 QuicCryptoClientStream::DoVerifyProofComplete"));
449 next_state_
= STATE_NONE
;
450 if (verify_details_
.get()) {
451 client_session()->OnProofVerifyDetailsAvailable(*verify_details_
);
453 UMA_HISTOGRAM_BOOLEAN("Net.QuicVerifyProofFailed.HandshakeConfirmed",
454 handshake_confirmed());
455 CloseConnectionWithDetails(
456 QUIC_PROOF_INVALID
, "Proof invalid: " + verify_error_details_
);
460 // Check if generation_counter has changed between STATE_VERIFY_PROOF and
461 // STATE_VERIFY_PROOF_COMPLETE state changes.
462 if (generation_counter_
!= cached
->generation_counter()) {
463 next_state_
= STATE_VERIFY_PROOF
;
465 SetCachedProofValid(cached
);
466 cached
->SetProofVerifyDetails(verify_details_
.release());
467 if (!handshake_confirmed()) {
468 next_state_
= STATE_GET_CHANNEL_ID
;
470 next_state_
= STATE_NONE
;
475 QuicAsyncStatus
QuicCryptoClientStream::DoGetChannelID(
476 QuicCryptoClientConfig::CachedState
* cached
) {
477 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
478 tracked_objects::ScopedTracker
tracking_profile(
479 FROM_HERE_WITH_EXPLICIT_FUNCTION(
480 "422516 QuicCryptoClientStream::DoGetChannelID"));
482 next_state_
= STATE_GET_CHANNEL_ID_COMPLETE
;
483 channel_id_key_
.reset();
484 if (!RequiresChannelID(cached
)) {
485 next_state_
= STATE_SEND_CHLO
;
489 ChannelIDSourceCallbackImpl
* channel_id_source_callback
=
490 new ChannelIDSourceCallbackImpl(this);
491 QuicAsyncStatus status
=
492 crypto_config_
->channel_id_source()->GetChannelIDKey(
493 server_id_
.host(), &channel_id_key_
,
494 channel_id_source_callback
);
498 channel_id_source_callback_
= channel_id_source_callback
;
499 DVLOG(1) << "Looking up channel ID";
502 next_state_
= STATE_NONE
;
503 delete channel_id_source_callback
;
504 CloseConnectionWithDetails(QUIC_INVALID_CHANNEL_ID_SIGNATURE
,
505 "Channel ID lookup failed");
508 delete channel_id_source_callback
;
514 void QuicCryptoClientStream::DoGetChannelIDComplete() {
515 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
516 tracked_objects::ScopedTracker
tracking_profile(
517 FROM_HERE_WITH_EXPLICIT_FUNCTION(
518 "422516 QuicCryptoClientStream::DoGetChannelIDComplete"));
520 if (!channel_id_key_
.get()) {
521 next_state_
= STATE_NONE
;
522 CloseConnectionWithDetails(QUIC_INVALID_CHANNEL_ID_SIGNATURE
,
523 "Channel ID lookup failed");
526 next_state_
= STATE_SEND_CHLO
;
529 void QuicCryptoClientStream::DoReceiveSHLO(
530 const CryptoHandshakeMessage
* in
,
531 QuicCryptoClientConfig::CachedState
* cached
) {
532 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
533 tracked_objects::ScopedTracker
tracking_profile(
534 FROM_HERE_WITH_EXPLICIT_FUNCTION(
535 "422516 QuicCryptoClientStream::DoReceiveSHLO"));
537 next_state_
= STATE_NONE
;
538 // We sent a CHLO that we expected to be accepted and now we're hoping
539 // for a SHLO from the server to confirm that.
540 if (in
->tag() == kREJ
) {
541 // alternative_decrypter will be nullptr if the original alternative
542 // decrypter latched and became the primary decrypter. That happens
543 // if we received a message encrypted with the INITIAL key.
544 if (session()->connection()->alternative_decrypter() == nullptr) {
545 // The rejection was sent encrypted!
546 CloseConnectionWithDetails(QUIC_CRYPTO_ENCRYPTION_LEVEL_INCORRECT
,
547 "encrypted REJ message");
550 next_state_
= STATE_RECV_REJ
;
554 if (in
->tag() != kSHLO
) {
555 CloseConnectionWithDetails(QUIC_INVALID_CRYPTO_MESSAGE_TYPE
,
556 "Expected SHLO or REJ");
560 // alternative_decrypter will be nullptr if the original alternative
561 // decrypter latched and became the primary decrypter. That happens
562 // if we received a message encrypted with the INITIAL key.
563 if (session()->connection()->alternative_decrypter() != nullptr) {
564 // The server hello was sent without encryption.
565 CloseConnectionWithDetails(QUIC_CRYPTO_ENCRYPTION_LEVEL_INCORRECT
,
566 "unencrypted SHLO message");
570 string error_details
;
571 QuicErrorCode error
= crypto_config_
->ProcessServerHello(
572 *in
, session()->connection()->connection_id(),
573 session()->connection()->server_supported_versions(),
574 cached
, &crypto_negotiated_params_
, &error_details
);
576 if (error
!= QUIC_NO_ERROR
) {
577 CloseConnectionWithDetails(error
, "Server hello invalid: " + error_details
);
580 error
= session()->config()->ProcessPeerHello(*in
, SERVER
, &error_details
);
581 if (error
!= QUIC_NO_ERROR
) {
582 CloseConnectionWithDetails(error
, "Server hello invalid: " + error_details
);
585 session()->OnConfigNegotiated();
587 CrypterPair
* crypters
= &crypto_negotiated_params_
.forward_secure_crypters
;
588 // TODO(agl): we don't currently latch this decrypter because the idea
589 // has been floated that the server shouldn't send packets encrypted
590 // with the FORWARD_SECURE key until it receives a FORWARD_SECURE
591 // packet from the client.
592 session()->connection()->SetAlternativeDecrypter(
593 crypters
->decrypter
.release(), ENCRYPTION_FORWARD_SECURE
,
594 false /* don't latch */);
595 session()->connection()->SetEncrypter(
596 ENCRYPTION_FORWARD_SECURE
, crypters
->encrypter
.release());
597 session()->connection()->SetDefaultEncryptionLevel(
598 ENCRYPTION_FORWARD_SECURE
);
600 handshake_confirmed_
= true;
601 session()->OnCryptoHandshakeEvent(QuicSession::HANDSHAKE_CONFIRMED
);
602 session()->connection()->OnHandshakeComplete();
605 void QuicCryptoClientStream::DoInitializeServerConfigUpdate(
606 QuicCryptoClientConfig::CachedState
* cached
) {
607 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
608 tracked_objects::ScopedTracker
tracking_profile(
609 FROM_HERE_WITH_EXPLICIT_FUNCTION(
610 "422516 QuicCryptoClientStream::DoInitializeServerConfigUpdate"));
612 bool update_ignored
= false;
613 if (!server_id_
.is_https()) {
614 // We don't check the certificates for insecure QUIC connections.
615 SetCachedProofValid(cached
);
616 next_state_
= STATE_NONE
;
617 } else if (!cached
->IsEmpty() && !cached
->signature().empty()) {
618 // Note that we verify the proof even if the cached proof is valid.
619 DCHECK(crypto_config_
->proof_verifier());
620 next_state_
= STATE_VERIFY_PROOF
;
622 update_ignored
= true;
623 next_state_
= STATE_NONE
;
625 UMA_HISTOGRAM_COUNTS("Net.QuicNumServerConfig.UpdateMessagesIgnored",
629 void QuicCryptoClientStream::SetCachedProofValid(
630 QuicCryptoClientConfig::CachedState
* cached
) {
631 cached
->SetProofValid();
632 client_session()->OnProofValid(*cached
);
635 bool QuicCryptoClientStream::RequiresChannelID(
636 QuicCryptoClientConfig::CachedState
* cached
) {
637 if (!server_id_
.is_https() ||
638 server_id_
.privacy_mode() == PRIVACY_MODE_ENABLED
||
639 !crypto_config_
->channel_id_source()) {
642 const CryptoHandshakeMessage
* scfg
= cached
->GetServerConfig();
643 if (!scfg
) { // scfg may be null then we send an inchoate CHLO.
646 const QuicTag
* their_proof_demands
;
647 size_t num_their_proof_demands
;
648 if (scfg
->GetTaglist(kPDMD
, &their_proof_demands
,
649 &num_their_proof_demands
) != QUIC_NO_ERROR
) {
652 for (size_t i
= 0; i
< num_their_proof_demands
; i
++) {
653 if (their_proof_demands
[i
] == kCHID
) {
660 QuicClientSessionBase
* QuicCryptoClientStream::client_session() {
661 return reinterpret_cast<QuicClientSessionBase
*>(session());