| 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/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "net/quic/crypto/cert_compressor.h" | 9 #include "net/quic/crypto/cert_compressor.h" |
| 10 #include "net/quic/crypto/chacha20_poly1305_encrypter.h" | 10 #include "net/quic/crypto/chacha20_poly1305_encrypter.h" |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 &num_reject_reasons) == QUIC_NO_ERROR) { | 594 &num_reject_reasons) == QUIC_NO_ERROR) { |
| 595 #if defined(DEBUG) | 595 #if defined(DEBUG) |
| 596 uint32 packed_error = 0; | 596 uint32 packed_error = 0; |
| 597 for (size_t i = 0; i < num_reject_reasons; ++i) { | 597 for (size_t i = 0; i < num_reject_reasons; ++i) { |
| 598 // HANDSHAKE_OK is 0 and don't report that as error. | 598 // HANDSHAKE_OK is 0 and don't report that as error. |
| 599 if (reject_reasons[i] == HANDSHAKE_OK || reject_reasons[i] >= 32) { | 599 if (reject_reasons[i] == HANDSHAKE_OK || reject_reasons[i] >= 32) { |
| 600 continue; | 600 continue; |
| 601 } | 601 } |
| 602 HandshakeFailureReason reason = | 602 HandshakeFailureReason reason = |
| 603 static_cast<HandshakeFailureReason>(reject_reasons[i]); | 603 static_cast<HandshakeFailureReason>(reject_reasons[i]); |
| 604 packed_error |= 1 << reason; | 604 packed_error |= 1 << (reason - 1); |
| 605 } | 605 } |
| 606 DVLOG(1) << "Reasons for rejection: " << packed_error; | 606 DVLOG(1) << "Reasons for rejection: " << packed_error; |
| 607 #endif | 607 #endif |
| 608 } | 608 } |
| 609 | 609 |
| 610 return QUIC_NO_ERROR; | 610 return QUIC_NO_ERROR; |
| 611 } | 611 } |
| 612 | 612 |
| 613 QuicErrorCode QuicCryptoClientConfig::ProcessServerHello( | 613 QuicErrorCode QuicCryptoClientConfig::ProcessServerHello( |
| 614 const CryptoHandshakeMessage& server_hello, | 614 const CryptoHandshakeMessage& server_hello, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 return; | 764 return; |
| 765 } | 765 } |
| 766 | 766 |
| 767 // Update canonical version to point at the "most recent" entry. | 767 // Update canonical version to point at the "most recent" entry. |
| 768 canonical_server_map_[suffix_server_id] = server_id; | 768 canonical_server_map_[suffix_server_id] = server_id; |
| 769 | 769 |
| 770 server_state->InitializeFrom(*canonical_state); | 770 server_state->InitializeFrom(*canonical_state); |
| 771 } | 771 } |
| 772 | 772 |
| 773 } // namespace net | 773 } // namespace net |
| OLD | NEW |