Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: net/quic/crypto/quic_crypto_client_config.cc

Issue 337263004: Minor change - subtract 1 from reject reason before left shifting while (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698