| 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/quic/quic_crypto_client_stream.h" | 5 #include "net/quic/quic_crypto_client_stream.h" |
| 6 | 6 |
| 7 #include "net/quic/crypto/crypto_protocol.h" | 7 #include "net/quic/crypto/crypto_protocol.h" |
| 8 #include "net/quic/crypto/crypto_utils.h" | 8 #include "net/quic/crypto/crypto_utils.h" |
| 9 #include "net/quic/crypto/null_encrypter.h" | 9 #include "net/quic/crypto/null_encrypter.h" |
| 10 #include "net/quic/crypto/proof_verifier.h" | 10 #include "net/quic/crypto/proof_verifier.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 ProofVerifier* verifier = crypto_config_->proof_verifier(); | 230 ProofVerifier* verifier = crypto_config_->proof_verifier(); |
| 231 DCHECK(verifier); | 231 DCHECK(verifier); |
| 232 next_state_ = STATE_VERIFY_PROOF_COMPLETE; | 232 next_state_ = STATE_VERIFY_PROOF_COMPLETE; |
| 233 generation_counter_ = cached->generation_counter(); | 233 generation_counter_ = cached->generation_counter(); |
| 234 | 234 |
| 235 ProofVerifierCallbackImpl* proof_verify_callback = | 235 ProofVerifierCallbackImpl* proof_verify_callback = |
| 236 new ProofVerifierCallbackImpl(this); | 236 new ProofVerifierCallbackImpl(this); |
| 237 | 237 |
| 238 verify_ok_ = false; | 238 verify_ok_ = false; |
| 239 | 239 |
| 240 ProofVerifier::Status status = verifier->VerifyProof( | 240 QuicAsyncStatus status = verifier->VerifyProof( |
| 241 server_id_.host(), | 241 server_id_.host(), |
| 242 cached->server_config(), | 242 cached->server_config(), |
| 243 cached->certs(), | 243 cached->certs(), |
| 244 cached->signature(), | 244 cached->signature(), |
| 245 verify_context_.get(), | 245 verify_context_.get(), |
| 246 &verify_error_details_, | 246 &verify_error_details_, |
| 247 &verify_details_, | 247 &verify_details_, |
| 248 proof_verify_callback); | 248 proof_verify_callback); |
| 249 | 249 |
| 250 switch (status) { | 250 switch (status) { |
| 251 case ProofVerifier::PENDING: | 251 case QUIC_PENDING: |
| 252 proof_verify_callback_ = proof_verify_callback; | 252 proof_verify_callback_ = proof_verify_callback; |
| 253 DVLOG(1) << "Doing VerifyProof"; | 253 DVLOG(1) << "Doing VerifyProof"; |
| 254 return; | 254 return; |
| 255 case ProofVerifier::FAILURE: | 255 case QUIC_FAILURE: |
| 256 delete proof_verify_callback; | 256 delete proof_verify_callback; |
| 257 break; | 257 break; |
| 258 case ProofVerifier::SUCCESS: | 258 case QUIC_SUCCESS: |
| 259 delete proof_verify_callback; | 259 delete proof_verify_callback; |
| 260 verify_ok_ = true; | 260 verify_ok_ = true; |
| 261 break; | 261 break; |
| 262 } | 262 } |
| 263 break; | 263 break; |
| 264 } | 264 } |
| 265 case STATE_VERIFY_PROOF_COMPLETE: | 265 case STATE_VERIFY_PROOF_COMPLETE: |
| 266 if (!verify_ok_) { | 266 if (!verify_ok_) { |
| 267 client_session()->OnProofVerifyDetailsAvailable(*verify_details_); | 267 client_session()->OnProofVerifyDetailsAvailable(*verify_details_); |
| 268 CloseConnectionWithDetails( | 268 CloseConnectionWithDetails( |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 QuicCryptoClientConfig::CachedState* cached) { | 358 QuicCryptoClientConfig::CachedState* cached) { |
| 359 cached->SetProofValid(); | 359 cached->SetProofValid(); |
| 360 client_session()->OnProofValid(*cached); | 360 client_session()->OnProofValid(*cached); |
| 361 } | 361 } |
| 362 | 362 |
| 363 QuicClientSessionBase* QuicCryptoClientStream::client_session() { | 363 QuicClientSessionBase* QuicCryptoClientStream::client_session() { |
| 364 return reinterpret_cast<QuicClientSessionBase*>(session()); | 364 return reinterpret_cast<QuicClientSessionBase*>(session()); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace net | 367 } // namespace net |
| OLD | NEW |