| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/crypto/quic_crypto_client_config.h" | 5 #include "net/quic/crypto/quic_crypto_client_config.h" |
| 6 | 6 |
| 7 #include "base/metrics/sparse_histogram.h" | 7 #include "base/metrics/sparse_histogram.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "net/quic/crypto/cert_compressor.h" | 10 #include "net/quic/crypto/cert_compressor.h" |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 } | 578 } |
| 579 } | 579 } |
| 580 | 580 |
| 581 return QUIC_NO_ERROR; | 581 return QUIC_NO_ERROR; |
| 582 } | 582 } |
| 583 | 583 |
| 584 QuicErrorCode QuicCryptoClientConfig::ProcessRejection( | 584 QuicErrorCode QuicCryptoClientConfig::ProcessRejection( |
| 585 const CryptoHandshakeMessage& rej, | 585 const CryptoHandshakeMessage& rej, |
| 586 QuicWallTime now, | 586 QuicWallTime now, |
| 587 CachedState* cached, | 587 CachedState* cached, |
| 588 bool is_https, |
| 588 QuicCryptoNegotiatedParameters* out_params, | 589 QuicCryptoNegotiatedParameters* out_params, |
| 589 string* error_details) { | 590 string* error_details) { |
| 590 DCHECK(error_details != NULL); | 591 DCHECK(error_details != NULL); |
| 591 | 592 |
| 592 if (rej.tag() != kREJ) { | 593 if (rej.tag() != kREJ) { |
| 593 *error_details = "Message is not REJ"; | 594 *error_details = "Message is not REJ"; |
| 594 return QUIC_CRYPTO_INTERNAL_ERROR; | 595 return QUIC_CRYPTO_INTERNAL_ERROR; |
| 595 } | 596 } |
| 596 | 597 |
| 597 QuicErrorCode error = CacheNewServerConfig(rej, now, out_params->cached_certs, | 598 QuicErrorCode error = CacheNewServerConfig(rej, now, out_params->cached_certs, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 614 for (size_t i = 0; i < num_reject_reasons; ++i) { | 615 for (size_t i = 0; i < num_reject_reasons; ++i) { |
| 615 // HANDSHAKE_OK is 0 and don't report that as error. | 616 // HANDSHAKE_OK is 0 and don't report that as error. |
| 616 if (reject_reasons[i] == HANDSHAKE_OK || reject_reasons[i] >= 32) { | 617 if (reject_reasons[i] == HANDSHAKE_OK || reject_reasons[i] >= 32) { |
| 617 continue; | 618 continue; |
| 618 } | 619 } |
| 619 HandshakeFailureReason reason = | 620 HandshakeFailureReason reason = |
| 620 static_cast<HandshakeFailureReason>(reject_reasons[i]); | 621 static_cast<HandshakeFailureReason>(reject_reasons[i]); |
| 621 packed_error |= 1 << (reason - 1); | 622 packed_error |= 1 << (reason - 1); |
| 622 } | 623 } |
| 623 DVLOG(1) << "Reasons for rejection: " << packed_error; | 624 DVLOG(1) << "Reasons for rejection: " << packed_error; |
| 624 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicClientHelloRejectReasons", | 625 if (is_https) { |
| 625 packed_error); | 626 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicClientHelloRejectReasons.Secure", |
| 627 packed_error); |
| 628 } else { |
| 629 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicClientHelloRejectReasons.Insecure", |
| 630 packed_error); |
| 631 } |
| 626 } | 632 } |
| 627 | 633 |
| 628 return QUIC_NO_ERROR; | 634 return QUIC_NO_ERROR; |
| 629 } | 635 } |
| 630 | 636 |
| 631 QuicErrorCode QuicCryptoClientConfig::ProcessServerHello( | 637 QuicErrorCode QuicCryptoClientConfig::ProcessServerHello( |
| 632 const CryptoHandshakeMessage& server_hello, | 638 const CryptoHandshakeMessage& server_hello, |
| 633 QuicConnectionId connection_id, | 639 QuicConnectionId connection_id, |
| 634 const QuicVersionVector& negotiated_versions, | 640 const QuicVersionVector& negotiated_versions, |
| 635 CachedState* cached, | 641 CachedState* cached, |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 return; | 805 return; |
| 800 } | 806 } |
| 801 | 807 |
| 802 // Update canonical version to point at the "most recent" entry. | 808 // Update canonical version to point at the "most recent" entry. |
| 803 canonical_server_map_[suffix_server_id] = server_id; | 809 canonical_server_map_[suffix_server_id] = server_id; |
| 804 | 810 |
| 805 server_state->InitializeFrom(*canonical_state); | 811 server_state->InitializeFrom(*canonical_state); |
| 806 } | 812 } |
| 807 | 813 |
| 808 } // namespace net | 814 } // namespace net |
| OLD | NEW |