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

Side by Side Diff: net/http/http_network_transaction.cc

Issue 14125003: Do not roll back to SSL 3.0 for Google properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove learning mode. Enforce TLS for Google's properties. Created 7 years, 8 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 unified diff | Download patch
OLDNEW
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/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 29 matching lines...) Expand all
40 #include "net/http/http_proxy_client_socket_pool.h" 40 #include "net/http/http_proxy_client_socket_pool.h"
41 #include "net/http/http_request_headers.h" 41 #include "net/http/http_request_headers.h"
42 #include "net/http/http_request_info.h" 42 #include "net/http/http_request_info.h"
43 #include "net/http/http_response_headers.h" 43 #include "net/http/http_response_headers.h"
44 #include "net/http/http_response_info.h" 44 #include "net/http/http_response_info.h"
45 #include "net/http/http_server_properties.h" 45 #include "net/http/http_server_properties.h"
46 #include "net/http/http_status_code.h" 46 #include "net/http/http_status_code.h"
47 #include "net/http/http_stream_base.h" 47 #include "net/http/http_stream_base.h"
48 #include "net/http/http_stream_factory.h" 48 #include "net/http/http_stream_factory.h"
49 #include "net/http/http_util.h" 49 #include "net/http/http_util.h"
50 #include "net/http/transport_security_state.h"
50 #include "net/http/url_security_manager.h" 51 #include "net/http/url_security_manager.h"
51 #include "net/socket/client_socket_factory.h" 52 #include "net/socket/client_socket_factory.h"
52 #include "net/socket/socks_client_socket_pool.h" 53 #include "net/socket/socks_client_socket_pool.h"
53 #include "net/socket/ssl_client_socket.h" 54 #include "net/socket/ssl_client_socket.h"
54 #include "net/socket/ssl_client_socket_pool.h" 55 #include "net/socket/ssl_client_socket_pool.h"
55 #include "net/socket/transport_client_socket_pool.h" 56 #include "net/socket/transport_client_socket_pool.h"
56 #include "net/spdy/spdy_http_stream.h" 57 #include "net/spdy/spdy_http_stream.h"
57 #include "net/spdy/spdy_session.h" 58 #include "net/spdy/spdy_session.h"
58 #include "net/spdy/spdy_session_pool.h" 59 #include "net/spdy/spdy_session_pool.h"
59 #include "net/ssl/ssl_cert_request_info.h" 60 #include "net/ssl/ssl_cert_request_info.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 171
171 net_log_ = net_log; 172 net_log_ = net_log;
172 request_ = request_info; 173 request_ = request_info;
173 start_time_ = base::Time::Now(); 174 start_time_ = base::Time::Now();
174 175
175 if (request_->load_flags & LOAD_DISABLE_CERT_REVOCATION_CHECKING) { 176 if (request_->load_flags & LOAD_DISABLE_CERT_REVOCATION_CHECKING) {
176 server_ssl_config_.rev_checking_enabled = false; 177 server_ssl_config_.rev_checking_enabled = false;
177 proxy_ssl_config_.rev_checking_enabled = false; 178 proxy_ssl_config_.rev_checking_enabled = false;
178 } 179 }
179 180
181
182 if (!server_ssl_config_.ssl_version_min_preloaded_disabled) {
183 // If this is a Google domain, set the minimum SSL version to TLS 1.0.
184 // This prevents SSLv3 fallback.
185 bool sni_available =
186 server_ssl_config_.version_max >= SSL_PROTOCOL_VERSION_TLS1 ||
187 server_ssl_config_.version_fallback;
agl 2013/04/15 15:23:51 I don't think version_fallback makes sense here. I
thaidn_google 2013/04/16 00:38:16 Done.
188 const std::string& host = request_->url.host();
189
190 if (TransportSecurityState::IsGooglePinnedProperty(host, sni_available)) {
Ryan Sleevi 2013/04/15 18:03:28 nit: net/ style is to omit braces on one-line if s
thaidn_google 2013/04/16 00:38:16 Done.
191 server_ssl_config_.version_min = SSL_PROTOCOL_VERSION_TLS1;
192 }
193 }
194
180 next_state_ = STATE_CREATE_STREAM; 195 next_state_ = STATE_CREATE_STREAM;
181 int rv = DoLoop(OK); 196 int rv = DoLoop(OK);
182 if (rv == ERR_IO_PENDING) 197 if (rv == ERR_IO_PENDING)
183 callback_ = callback; 198 callback_ = callback;
184 return rv; 199 return rv;
185 } 200 }
186 201
187 int HttpNetworkTransaction::RestartIgnoringLastError( 202 int HttpNetworkTransaction::RestartIgnoringLastError(
188 const CompletionCallback& callback) { 203 const CompletionCallback& callback) {
189 DCHECK(!stream_.get()); 204 DCHECK(!stream_.get());
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1476 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1462 state); 1477 state);
1463 break; 1478 break;
1464 } 1479 }
1465 return description; 1480 return description;
1466 } 1481 }
1467 1482
1468 #undef STATE_CASE 1483 #undef STATE_CASE
1469 1484
1470 } // namespace net 1485 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698