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/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 Loading... |
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, ¶ms->aead, nullptr) || | 871 ¶ms->aead, nullptr) || |
872 !QuicUtils::FindMutualTag(requested_config->kexs, their_key_exchanges, | 872 !FindMutualQuicTag(requested_config->kexs, their_key_exchanges, |
873 num_their_key_exchanges, ¶ms->key_exchange, | 873 num_their_key_exchanges, ¶ms->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, ¶ms->token_binding_key_param, |
888 ¶ms->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 Loading... |
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 |
OLD | NEW |