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

Unified Diff: net/quic/core/crypto/quic_crypto_client_config.cc

Issue 2907743003: Change CryptoHandshakeMessage::GetTaglist to tag a QuicTagVector* (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/core/crypto/quic_crypto_client_config.cc
diff --git a/net/quic/core/crypto/quic_crypto_client_config.cc b/net/quic/core/crypto/quic_crypto_client_config.cc
index 2a80d68bd30e4b0b3bb6e81dd81a1cfbd62aa88a..fcd630ac24ce1949d7cbcaee44ccf81f079980a1 100644
--- a/net/quic/core/crypto/quic_crypto_client_config.cc
+++ b/net/quic/core/crypto/quic_crypto_client_config.cc
@@ -527,13 +527,10 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
out->SetStringPiece(kCertificateSCTTag, "");
- const QuicTag* their_aeads;
- const QuicTag* their_key_exchanges;
- size_t num_their_aeads, num_their_key_exchanges;
- if (scfg->GetTaglist(kAEAD, &their_aeads, &num_their_aeads) !=
- QUIC_NO_ERROR ||
- scfg->GetTaglist(kKEXS, &their_key_exchanges, &num_their_key_exchanges) !=
- QUIC_NO_ERROR) {
+ QuicTagVector their_aeads;
+ QuicTagVector their_key_exchanges;
+ if (scfg->GetTaglist(kAEAD, &their_aeads) != QUIC_NO_ERROR ||
+ scfg->GetTaglist(kKEXS, &their_key_exchanges) != QUIC_NO_ERROR) {
*error_details = "Missing AEAD or KEXS";
return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
}
@@ -544,10 +541,11 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
// Key exchange: the client does more work than the server, so favor the
// client's preference.
size_t key_exchange_index;
- if (!FindMutualQuicTag(aead, their_aeads, num_their_aeads, &out_params->aead,
- nullptr) ||
- !FindMutualQuicTag(kexs, their_key_exchanges, num_their_key_exchanges,
- &out_params->key_exchange, &key_exchange_index)) {
+ if (!FindMutualQuicTag(aead, their_aeads.data(), their_aeads.size(),
+ &out_params->aead, nullptr) ||
+ !FindMutualQuicTag(kexs, their_key_exchanges.data(),
+ their_key_exchanges.size(), &out_params->key_exchange,
+ &key_exchange_index)) {
*error_details = "Unsupported AEAD or KEXS";
return QUIC_CRYPTO_NO_SUPPORT;
}
@@ -556,13 +554,13 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
if (!tb_key_params.empty() &&
server_id.privacy_mode() == PRIVACY_MODE_DISABLED) {
- const QuicTag* their_tbkps;
- size_t num_their_tbkps;
- switch (scfg->GetTaglist(kTBKP, &their_tbkps, &num_their_tbkps)) {
+ QuicTagVector their_tbkps;
+ switch (scfg->GetTaglist(kTBKP, &their_tbkps)) {
case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND:
break;
case QUIC_NO_ERROR:
- if (FindMutualQuicTag(tb_key_params, their_tbkps, num_their_tbkps,
+ if (FindMutualQuicTag(tb_key_params, their_tbkps.data(),
+ their_tbkps.size(),
&out_params->token_binding_key_param, nullptr)) {
out->SetVector(kTBKP,
QuicTagVector{out_params->token_binding_key_param});

Powered by Google App Engine
This is Rietveld 408576698