| 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_server_config.h" | 5 #include "net/quic/crypto/quic_crypto_server_config.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 clock->WallNow(), cached_network_params); | 1193 clock->WallNow(), cached_network_params); |
| 1194 } | 1194 } |
| 1195 | 1195 |
| 1196 out->set_tag(kSCUP); | 1196 out->set_tag(kSCUP); |
| 1197 out->SetStringPiece(kSCFG, serialized); | 1197 out->SetStringPiece(kSCFG, serialized); |
| 1198 out->SetStringPiece(kSourceAddressTokenTag, source_address_token); | 1198 out->SetStringPiece(kSourceAddressTokenTag, source_address_token); |
| 1199 | 1199 |
| 1200 scoped_refptr<ProofSource::Chain> chain; | 1200 scoped_refptr<ProofSource::Chain> chain; |
| 1201 string signature; | 1201 string signature; |
| 1202 string cert_sct; | 1202 string cert_sct; |
| 1203 if (FLAGS_quic_use_hash_in_scup) { | 1203 if (!proof_source_->GetProof(server_ip, params.sni, serialized, version, |
| 1204 if (!proof_source_->GetProof(server_ip, params.sni, serialized, version, | 1204 chlo_hash, params.x509_ecdsa_supported, &chain, |
| 1205 chlo_hash, params.x509_ecdsa_supported, &chain, | 1205 &signature, &cert_sct)) { |
| 1206 &signature, &cert_sct)) { | 1206 DVLOG(1) << "Server: failed to get proof."; |
| 1207 DVLOG(1) << "Server: failed to get proof."; | 1207 return false; |
| 1208 return false; | |
| 1209 } | |
| 1210 } else { | |
| 1211 if (!proof_source_->GetProof( | |
| 1212 server_ip, params.sni, serialized, version, params.client_nonce, | |
| 1213 params.x509_ecdsa_supported, &chain, &signature, &cert_sct)) { | |
| 1214 DVLOG(1) << "Server: failed to get proof."; | |
| 1215 return false; | |
| 1216 } | |
| 1217 } | 1208 } |
| 1218 | 1209 |
| 1219 const string compressed = CompressChain( | 1210 const string compressed = CompressChain( |
| 1220 compressed_certs_cache, chain, params.client_common_set_hashes, | 1211 compressed_certs_cache, chain, params.client_common_set_hashes, |
| 1221 params.client_cached_cert_hashes, common_cert_sets); | 1212 params.client_cached_cert_hashes, common_cert_sets); |
| 1222 | 1213 |
| 1223 out->SetStringPiece(kCertificateTag, compressed); | 1214 out->SetStringPiece(kCertificateTag, compressed); |
| 1224 out->SetStringPiece(kPROF, signature); | 1215 out->SetStringPiece(kPROF, signature); |
| 1225 if (params.sct_supported_by_client && version > QUIC_VERSION_29 && | 1216 if (params.sct_supported_by_client && version > QUIC_VERSION_29 && |
| 1226 enable_serving_sct_) { | 1217 enable_serving_sct_) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 CryptoHandshakeMessage message; | 1251 CryptoHandshakeMessage message; |
| 1261 message.set_tag(kSCUP); | 1252 message.set_tag(kSCUP); |
| 1262 message.SetStringPiece(kSCFG, serialized); | 1253 message.SetStringPiece(kSCFG, serialized); |
| 1263 message.SetStringPiece(kSourceAddressTokenTag, source_address_token); | 1254 message.SetStringPiece(kSourceAddressTokenTag, source_address_token); |
| 1264 | 1255 |
| 1265 std::unique_ptr<BuildServerConfigUpdateMessageProofSourceCallback> | 1256 std::unique_ptr<BuildServerConfigUpdateMessageProofSourceCallback> |
| 1266 proof_source_cb(new BuildServerConfigUpdateMessageProofSourceCallback( | 1257 proof_source_cb(new BuildServerConfigUpdateMessageProofSourceCallback( |
| 1267 this, version, compressed_certs_cache, common_cert_sets, params, | 1258 this, version, compressed_certs_cache, common_cert_sets, params, |
| 1268 std::move(message), std::move(cb))); | 1259 std::move(message), std::move(cb))); |
| 1269 | 1260 |
| 1270 if (FLAGS_quic_use_hash_in_scup) { | 1261 proof_source_->GetProof(server_ip, params.sni, serialized, version, chlo_hash, |
| 1271 proof_source_->GetProof(server_ip, params.sni, serialized, version, | 1262 params.x509_ecdsa_supported, |
| 1272 chlo_hash, params.x509_ecdsa_supported, | 1263 std::move(proof_source_cb)); |
| 1273 std::move(proof_source_cb)); | |
| 1274 } else { | |
| 1275 proof_source_->GetProof(server_ip, params.sni, serialized, version, | |
| 1276 params.client_nonce, params.x509_ecdsa_supported, | |
| 1277 std::move(proof_source_cb)); | |
| 1278 } | |
| 1279 } | 1264 } |
| 1280 | 1265 |
| 1281 QuicCryptoServerConfig::BuildServerConfigUpdateMessageProofSourceCallback:: | 1266 QuicCryptoServerConfig::BuildServerConfigUpdateMessageProofSourceCallback:: |
| 1282 ~BuildServerConfigUpdateMessageProofSourceCallback() {} | 1267 ~BuildServerConfigUpdateMessageProofSourceCallback() {} |
| 1283 | 1268 |
| 1284 QuicCryptoServerConfig::BuildServerConfigUpdateMessageProofSourceCallback:: | 1269 QuicCryptoServerConfig::BuildServerConfigUpdateMessageProofSourceCallback:: |
| 1285 BuildServerConfigUpdateMessageProofSourceCallback( | 1270 BuildServerConfigUpdateMessageProofSourceCallback( |
| 1286 const QuicCryptoServerConfig* config, | 1271 const QuicCryptoServerConfig* config, |
| 1287 QuicVersion version, | 1272 QuicVersion version, |
| 1288 QuicCompressedCertsCache* compressed_certs_cache, | 1273 QuicCompressedCertsCache* compressed_certs_cache, |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1965 priority(0), | 1950 priority(0), |
| 1966 source_address_token_boxer(nullptr) {} | 1951 source_address_token_boxer(nullptr) {} |
| 1967 | 1952 |
| 1968 QuicCryptoServerConfig::Config::~Config() { | 1953 QuicCryptoServerConfig::Config::~Config() { |
| 1969 STLDeleteElements(&key_exchanges); | 1954 STLDeleteElements(&key_exchanges); |
| 1970 } | 1955 } |
| 1971 | 1956 |
| 1972 QuicCryptoProof::QuicCryptoProof() {} | 1957 QuicCryptoProof::QuicCryptoProof() {} |
| 1973 QuicCryptoProof::~QuicCryptoProof() {} | 1958 QuicCryptoProof::~QuicCryptoProof() {} |
| 1974 } // namespace net | 1959 } // namespace net |
| OLD | NEW |