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

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

Issue 453693002: Check return value of GetStringPiece for (optional) kCCRT/kCCS in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Store_client_cert_hashes_72724874
Patch Set: Created 6 years, 4 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
« 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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 1132
1133 const vector<string>* certs; 1133 const vector<string>* certs;
1134 string signature; 1134 string signature;
1135 if (!proof_source_->GetProof(info.sni.as_string(), config.serialized, 1135 if (!proof_source_->GetProof(info.sni.as_string(), config.serialized,
1136 params->x509_ecdsa_supported, &certs, 1136 params->x509_ecdsa_supported, &certs,
1137 &signature)) { 1137 &signature)) {
1138 return; 1138 return;
1139 } 1139 }
1140 1140
1141 StringPiece client_common_set_hashes; 1141 StringPiece client_common_set_hashes;
1142 client_hello.GetStringPiece(kCCS, &client_common_set_hashes); 1142 if (client_hello.GetStringPiece(kCCS, &client_common_set_hashes)) {
1143 params->client_common_set_hashes = client_common_set_hashes.as_string(); 1143 params->client_common_set_hashes = client_common_set_hashes.as_string();
1144 }
1144 1145
1145 StringPiece client_cached_cert_hashes; 1146 StringPiece client_cached_cert_hashes;
1146 client_hello.GetStringPiece(kCCRT, &client_cached_cert_hashes); 1147 if (client_hello.GetStringPiece(kCCRT, &client_cached_cert_hashes)) {
1147 params->client_cached_cert_hashes = client_cached_cert_hashes.as_string(); 1148 params->client_cached_cert_hashes = client_cached_cert_hashes.as_string();
1149 }
1148 1150
1149 const string compressed = CertCompressor::CompressChain( 1151 const string compressed = CertCompressor::CompressChain(
1150 *certs, params->client_common_set_hashes, 1152 *certs, params->client_common_set_hashes,
1151 params->client_cached_cert_hashes, config.common_cert_sets); 1153 params->client_cached_cert_hashes, config.common_cert_sets);
1152 1154
1153 // kREJOverheadBytes is a very rough estimate of how much of a REJ 1155 // kREJOverheadBytes is a very rough estimate of how much of a REJ
1154 // message is taken up by things other than the certificates. 1156 // message is taken up by things other than the certificates.
1155 // STK: 56 bytes 1157 // STK: 56 bytes
1156 // SNO: 56 bytes 1158 // SNO: 56 bytes
1157 // SCFG 1159 // SCFG
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 QuicCryptoServerConfig::Config::Config() 1554 QuicCryptoServerConfig::Config::Config()
1553 : channel_id_enabled(false), 1555 : channel_id_enabled(false),
1554 is_primary(false), 1556 is_primary(false),
1555 primary_time(QuicWallTime::Zero()), 1557 primary_time(QuicWallTime::Zero()),
1556 priority(0), 1558 priority(0),
1557 source_address_token_boxer(NULL) {} 1559 source_address_token_boxer(NULL) {}
1558 1560
1559 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } 1561 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); }
1560 1562
1561 } // namespace net 1563 } // 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