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

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

Issue 391283003: Reduce the scope of a spurious WARNING log when processing strike (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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_server_config.h" 5 #include "net/quic/crypto/quic_crypto_server_config.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 break; 167 break;
168 case NONCE_INVALID_TIME_FAILURE: 168 case NONCE_INVALID_TIME_FAILURE:
169 client_nonce_error = CLIENT_NONCE_INVALID_TIME_FAILURE; 169 client_nonce_error = CLIENT_NONCE_INVALID_TIME_FAILURE;
170 break; 170 break;
171 case STRIKE_REGISTER_TIMEOUT: 171 case STRIKE_REGISTER_TIMEOUT:
172 client_nonce_error = CLIENT_NONCE_STRIKE_REGISTER_TIMEOUT; 172 client_nonce_error = CLIENT_NONCE_STRIKE_REGISTER_TIMEOUT;
173 break; 173 break;
174 case STRIKE_REGISTER_FAILURE: 174 case STRIKE_REGISTER_FAILURE:
175 client_nonce_error = CLIENT_NONCE_STRIKE_REGISTER_FAILURE; 175 client_nonce_error = CLIENT_NONCE_STRIKE_REGISTER_FAILURE;
176 break; 176 break;
177 case NONCE_UNKNOWN_FAILURE:
178 client_nonce_error = CLIENT_NONCE_UNKNOWN_FAILURE;
179 break;
177 case NONCE_OK: 180 case NONCE_OK:
178 case NONCE_UNKNOWN_FAILURE:
179 default: 181 default:
180 LOG(WARNING) << "Unexpected nonce error: " << nonce_error; 182 LOG(DFATAL) << "Unexpected client nonce error: " << nonce_error;
181 client_nonce_error = CLIENT_NONCE_UNKNOWN_FAILURE; 183 client_nonce_error = CLIENT_NONCE_UNKNOWN_FAILURE;
182 break; 184 break;
183 } 185 }
184 result_->info.reject_reasons.push_back(client_nonce_error); 186 result_->info.reject_reasons.push_back(client_nonce_error);
185 } 187 }
186 done_cb_->Run(result_); 188 done_cb_->Run(result_);
187 } 189 }
188 190
189 private: 191 private:
190 ValidateClientHelloResultCallback::Result* result_; 192 ValidateClientHelloResultCallback::Result* result_;
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 StrikeRegister::NO_STARTUP_PERIOD_NEEDED)); 1480 StrikeRegister::NO_STARTUP_PERIOD_NEEDED));
1479 } 1481 }
1480 nonce_error = server_nonce_strike_register_->Insert( 1482 nonce_error = server_nonce_strike_register_->Insert(
1481 server_nonce, static_cast<uint32>(now.ToUNIXSeconds())); 1483 server_nonce, static_cast<uint32>(now.ToUNIXSeconds()));
1482 } 1484 }
1483 1485
1484 switch (nonce_error) { 1486 switch (nonce_error) {
1485 case NONCE_OK: 1487 case NONCE_OK:
1486 return HANDSHAKE_OK; 1488 return HANDSHAKE_OK;
1487 case NONCE_INVALID_FAILURE: 1489 case NONCE_INVALID_FAILURE:
1490 case NONCE_INVALID_ORBIT_FAILURE:
1488 return SERVER_NONCE_INVALID_FAILURE; 1491 return SERVER_NONCE_INVALID_FAILURE;
1489 case NONCE_NOT_UNIQUE_FAILURE: 1492 case NONCE_NOT_UNIQUE_FAILURE:
1490 return SERVER_NONCE_NOT_UNIQUE_FAILURE; 1493 return SERVER_NONCE_NOT_UNIQUE_FAILURE;
1491 case NONCE_INVALID_TIME_FAILURE: 1494 case NONCE_INVALID_TIME_FAILURE:
1492 return SERVER_NONCE_INVALID_TIME_FAILURE; 1495 return SERVER_NONCE_INVALID_TIME_FAILURE;
1493 case NONCE_UNKNOWN_FAILURE: 1496 case NONCE_UNKNOWN_FAILURE:
1494 case NONCE_INVALID_ORBIT_FAILURE:
1495 case STRIKE_REGISTER_TIMEOUT: 1497 case STRIKE_REGISTER_TIMEOUT:
1496 case STRIKE_REGISTER_FAILURE: 1498 case STRIKE_REGISTER_FAILURE:
1497 default: 1499 default:
1498 LOG(WARNING) << "Unexpected nonce error: " << nonce_error; 1500 LOG(DFATAL) << "Unexpected server nonce error: " << nonce_error;
1499 return SERVER_NONCE_NOT_UNIQUE_FAILURE; 1501 return SERVER_NONCE_NOT_UNIQUE_FAILURE;
1500 } 1502 }
1501 } 1503 }
1502 1504
1503 QuicCryptoServerConfig::Config::Config() 1505 QuicCryptoServerConfig::Config::Config()
1504 : channel_id_enabled(false), 1506 : channel_id_enabled(false),
1505 is_primary(false), 1507 is_primary(false),
1506 primary_time(QuicWallTime::Zero()), 1508 primary_time(QuicWallTime::Zero()),
1507 priority(0), 1509 priority(0),
1508 source_address_token_boxer(NULL) {} 1510 source_address_token_boxer(NULL) {}
1509 1511
1510 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } 1512 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); }
1511 1513
1512 } // namespace net 1514 } // 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