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" |
11 #include "net/base/connection_type_histograms.h" | 11 #include "net/base/connection_type_histograms.h" |
12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 13 #include "net/socket/ssl_client_socket_openssl.h" |
13 #include "net/ssl/channel_id_service.h" | 14 #include "net/ssl/channel_id_service.h" |
14 #include "net/ssl/ssl_cipher_suite_names.h" | 15 #include "net/ssl/ssl_cipher_suite_names.h" |
15 #include "net/ssl/ssl_config_service.h" | 16 #include "net/ssl/ssl_config_service.h" |
16 #include "net/ssl/ssl_connection_status_flags.h" | 17 #include "net/ssl/ssl_connection_status_flags.h" |
17 | 18 |
18 #if defined(USE_OPENSSL) | |
19 #include "net/socket/ssl_client_socket_openssl.h" | |
20 #endif | |
21 | 19 |
22 namespace net { | 20 namespace net { |
23 | 21 |
24 SSLClientSocket::SSLClientSocket() | 22 SSLClientSocket::SSLClientSocket() |
25 : signed_cert_timestamps_received_(false), | 23 : signed_cert_timestamps_received_(false), |
26 stapled_ocsp_response_received_(false), | 24 stapled_ocsp_response_received_(false), |
27 negotiation_extension_(kExtensionUnknown) { | 25 negotiation_extension_(kExtensionUnknown) { |
28 } | 26 } |
29 | 27 |
30 // static | 28 // static |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 case kNextProtoNoOverlap: | 69 case kNextProtoNoOverlap: |
72 return "no-overlap"; | 70 return "no-overlap"; |
73 } | 71 } |
74 return NULL; | 72 return NULL; |
75 } | 73 } |
76 | 74 |
77 // static | 75 // static |
78 void SSLClientSocket::SetSSLKeyLogFile( | 76 void SSLClientSocket::SetSSLKeyLogFile( |
79 const base::FilePath& path, | 77 const base::FilePath& path, |
80 const scoped_refptr<base::SequencedTaskRunner>& task_runner) { | 78 const scoped_refptr<base::SequencedTaskRunner>& task_runner) { |
81 #if defined(USE_OPENSSL) && !defined(OS_NACL) | 79 #if !defined(OS_NACL) |
82 SSLClientSocketOpenSSL::SetSSLKeyLogFile(path, task_runner); | 80 SSLClientSocketOpenSSL::SetSSLKeyLogFile(path, task_runner); |
83 #else | 81 #else |
84 NOTIMPLEMENTED(); | 82 NOTIMPLEMENTED(); |
85 #endif | 83 #endif |
86 } | 84 } |
87 | 85 |
88 bool SSLClientSocket::WasNpnNegotiated() const { | 86 bool SSLClientSocket::WasNpnNegotiated() const { |
89 std::string unused_proto; | 87 std::string unused_proto; |
90 return GetNextProto(&unused_proto) == kNextProtoNegotiated; | 88 return GetNextProto(&unused_proto) == kNextProtoNegotiated; |
91 } | 89 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 wire_protos.push_back(proto.size()); | 202 wire_protos.push_back(proto.size()); |
205 for (const char ch : proto) { | 203 for (const char ch : proto) { |
206 wire_protos.push_back(static_cast<uint8_t>(ch)); | 204 wire_protos.push_back(static_cast<uint8_t>(ch)); |
207 } | 205 } |
208 } | 206 } |
209 | 207 |
210 return wire_protos; | 208 return wire_protos; |
211 } | 209 } |
212 | 210 |
213 } // namespace net | 211 } // namespace net |
OLD | NEW |