OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/socket/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "base/metrics/sparse_histogram.h" | 8 #include "base/metrics/sparse_histogram.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "crypto/ec_private_key.h" | 10 #include "crypto/ec_private_key.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 return false; | 174 return false; |
175 if (!channel_id_service) { | 175 if (!channel_id_service) { |
176 DVLOG(1) << "NULL channel_id_service_, not enabling channel ID."; | 176 DVLOG(1) << "NULL channel_id_service_, not enabling channel ID."; |
177 return false; | 177 return false; |
178 } | 178 } |
179 return true; | 179 return true; |
180 } | 180 } |
181 | 181 |
182 // static | 182 // static |
183 bool SSLClientSocket::HasCipherAdequateForHTTP2( | 183 bool SSLClientSocket::HasCipherAdequateForHTTP2( |
184 const std::vector<uint16>& cipher_suites) { | 184 const std::vector<uint16_t>& cipher_suites) { |
185 for (uint16 cipher : cipher_suites) { | 185 for (uint16_t cipher : cipher_suites) { |
186 if (IsTLSCipherSuiteAllowedByHTTP2(cipher)) | 186 if (IsTLSCipherSuiteAllowedByHTTP2(cipher)) |
187 return true; | 187 return true; |
188 } | 188 } |
189 return false; | 189 return false; |
190 } | 190 } |
191 | 191 |
192 // static | 192 // static |
193 bool SSLClientSocket::IsTLSVersionAdequateForHTTP2( | 193 bool SSLClientSocket::IsTLSVersionAdequateForHTTP2( |
194 const SSLConfig& ssl_config) { | 194 const SSLConfig& ssl_config) { |
195 return ssl_config.version_max >= SSL_PROTOCOL_VERSION_TLS1_2; | 195 return ssl_config.version_max >= SSL_PROTOCOL_VERSION_TLS1_2; |
(...skipping 16 matching lines...) Expand all Loading... |
212 wire_protos.push_back(proto.size()); | 212 wire_protos.push_back(proto.size()); |
213 for (const char ch : proto) { | 213 for (const char ch : proto) { |
214 wire_protos.push_back(static_cast<uint8_t>(ch)); | 214 wire_protos.push_back(static_cast<uint8_t>(ch)); |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 return wire_protos; | 218 return wire_protos; |
219 } | 219 } |
220 | 220 |
221 } // namespace net | 221 } // namespace net |
OLD | NEW |