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

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

Issue 2517603003: Moves QuicTag typedefs, and QuicTag utility methods to quic_tag.{h,cc}. No behavior change. (Closed)
Patch Set: Created 4 years, 1 month 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 | « net/quic/core/crypto/quic_crypto_client_config.cc ('k') | net/quic/core/quic_config.cc » ('j') | 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/core/crypto/quic_crypto_server_config.h" 5 #include "net/quic/core/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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 QUIC_NO_ERROR || 860 QUIC_NO_ERROR ||
861 client_hello.GetTaglist(kKEXS, &their_key_exchanges, 861 client_hello.GetTaglist(kKEXS, &their_key_exchanges,
862 &num_their_key_exchanges) != QUIC_NO_ERROR || 862 &num_their_key_exchanges) != QUIC_NO_ERROR ||
863 num_their_aeads != 1 || num_their_key_exchanges != 1) { 863 num_their_aeads != 1 || num_their_key_exchanges != 1) {
864 helper.Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER, 864 helper.Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER,
865 "Missing or invalid AEAD or KEXS"); 865 "Missing or invalid AEAD or KEXS");
866 return; 866 return;
867 } 867 }
868 868
869 size_t key_exchange_index; 869 size_t key_exchange_index;
870 if (!QuicUtils::FindMutualTag(requested_config->aead, their_aeads, 870 if (!FindMutualQuicTag(requested_config->aead, their_aeads, num_their_aeads,
871 num_their_aeads, &params->aead, nullptr) || 871 &params->aead, nullptr) ||
872 !QuicUtils::FindMutualTag(requested_config->kexs, their_key_exchanges, 872 !FindMutualQuicTag(requested_config->kexs, their_key_exchanges,
873 num_their_key_exchanges, &params->key_exchange, 873 num_their_key_exchanges, &params->key_exchange,
874 &key_exchange_index)) { 874 &key_exchange_index)) {
875 helper.Fail(QUIC_CRYPTO_NO_SUPPORT, "Unsupported AEAD or KEXS"); 875 helper.Fail(QUIC_CRYPTO_NO_SUPPORT, "Unsupported AEAD or KEXS");
876 return; 876 return;
877 } 877 }
878 878
879 if (!requested_config->tb_key_params.empty()) { 879 if (!requested_config->tb_key_params.empty()) {
880 const QuicTag* their_tbkps; 880 const QuicTag* their_tbkps;
881 size_t num_their_tbkps; 881 size_t num_their_tbkps;
882 switch (client_hello.GetTaglist(kTBKP, &their_tbkps, &num_their_tbkps)) { 882 switch (client_hello.GetTaglist(kTBKP, &their_tbkps, &num_their_tbkps)) {
883 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND: 883 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND:
884 break; 884 break;
885 case QUIC_NO_ERROR: 885 case QUIC_NO_ERROR:
886 if (QuicUtils::FindMutualTag( 886 if (FindMutualQuicTag(requested_config->tb_key_params, their_tbkps,
887 requested_config->tb_key_params, their_tbkps, num_their_tbkps, 887 num_their_tbkps, &params->token_binding_key_param,
888 &params->token_binding_key_param, nullptr)) { 888 nullptr)) {
889 break; 889 break;
890 } 890 }
891 default: 891 default:
892 helper.Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER, 892 helper.Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER,
893 "Invalid Token Binding key parameter"); 893 "Invalid Token Binding key parameter");
894 return; 894 return;
895 } 895 }
896 } 896 }
897 897
898 StringPiece public_value; 898 StringPiece public_value;
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after
2202 source_address_token_boxer(nullptr) {} 2202 source_address_token_boxer(nullptr) {}
2203 2203
2204 QuicCryptoServerConfig::Config::~Config() { 2204 QuicCryptoServerConfig::Config::~Config() {
2205 } 2205 }
2206 2206
2207 QuicSignedServerConfig::QuicSignedServerConfig() 2207 QuicSignedServerConfig::QuicSignedServerConfig()
2208 : send_expect_ct_header(false) {} 2208 : send_expect_ct_header(false) {}
2209 QuicSignedServerConfig::~QuicSignedServerConfig() {} 2209 QuicSignedServerConfig::~QuicSignedServerConfig() {}
2210 2210
2211 } // namespace net 2211 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/crypto/quic_crypto_client_config.cc ('k') | net/quic/core/quic_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698