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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 422063004: Certificate Transparency: Require SCTs for EV certificates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed histogram enum names Created 6 years 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 | « chrome/browser/io_thread.h ('k') | chrome/common/chrome_switches.h » ('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 (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 "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" 46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h"
47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prot ocol.h" 47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prot ocol.h"
48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
49 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" 49 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
50 #include "components/policy/core/common/policy_service.h" 50 #include "components/policy/core/common/policy_service.h"
51 #include "components/variations/variations_associated_data.h" 51 #include "components/variations/variations_associated_data.h"
52 #include "content/public/browser/browser_thread.h" 52 #include "content/public/browser/browser_thread.h"
53 #include "content/public/browser/cookie_store_factory.h" 53 #include "content/public/browser/cookie_store_factory.h"
54 #include "net/base/host_mapping_rules.h" 54 #include "net/base/host_mapping_rules.h"
55 #include "net/base/net_util.h" 55 #include "net/base/net_util.h"
56 #include "net/cert/cert_policy_enforcer.h"
56 #include "net/cert/cert_verifier.h" 57 #include "net/cert/cert_verifier.h"
57 #include "net/cert/cert_verify_proc.h" 58 #include "net/cert/cert_verify_proc.h"
58 #include "net/cert/ct_known_logs.h" 59 #include "net/cert/ct_known_logs.h"
60 #include "net/cert/ct_known_logs_static.h"
59 #include "net/cert/ct_log_verifier.h" 61 #include "net/cert/ct_log_verifier.h"
60 #include "net/cert/ct_verifier.h" 62 #include "net/cert/ct_verifier.h"
61 #include "net/cert/multi_log_ct_verifier.h" 63 #include "net/cert/multi_log_ct_verifier.h"
62 #include "net/cert/multi_threaded_cert_verifier.h" 64 #include "net/cert/multi_threaded_cert_verifier.h"
63 #include "net/cookies/cookie_store.h" 65 #include "net/cookies/cookie_store.h"
64 #include "net/dns/host_cache.h" 66 #include "net/dns/host_cache.h"
65 #include "net/dns/host_resolver.h" 67 #include "net/dns/host_resolver.h"
66 #include "net/dns/mapped_host_resolver.h" 68 #include "net/dns/mapped_host_resolver.h"
67 #include "net/ftp/ftp_network_layer.h" 69 #include "net/ftp/ftp_network_layer.h"
68 #include "net/http/http_auth_filter.h" 70 #include "net/http/http_auth_filter.h"
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 &ct_public_key_data)) 637 &ct_public_key_data))
636 << "Unable to decode CT public key."; 638 << "Unable to decode CT public key.";
637 scoped_ptr<net::CTLogVerifier> external_log_verifier( 639 scoped_ptr<net::CTLogVerifier> external_log_verifier(
638 net::CTLogVerifier::Create(ct_public_key_data, log_description)); 640 net::CTLogVerifier::Create(ct_public_key_data, log_description));
639 CHECK(external_log_verifier) << "Unable to parse CT public key."; 641 CHECK(external_log_verifier) << "Unable to parse CT public key.";
640 VLOG(1) << "Adding log with description " << log_description; 642 VLOG(1) << "Adding log with description " << log_description;
641 ct_verifier->AddLog(external_log_verifier.Pass()); 643 ct_verifier->AddLog(external_log_verifier.Pass());
642 } 644 }
643 } 645 }
644 646
647 net::CertPolicyEnforcer* policy_enforcer = NULL;
648 // TODO(eranm): Control with Finch, crbug.com/437766
649 if (command_line.HasSwitch(switches::kRequireCTForEV)) {
650 policy_enforcer = new net::CertPolicyEnforcer(kNumKnownCTLogs, true);
651 } else {
652 policy_enforcer = new net::CertPolicyEnforcer(kNumKnownCTLogs, false);
653 }
654 globals_->cert_policy_enforcer.reset(policy_enforcer);
655
645 globals_->ssl_config_service = GetSSLConfigService(); 656 globals_->ssl_config_service = GetSSLConfigService();
646 657
647 SetupDataReductionProxy(network_delegate); 658 SetupDataReductionProxy(network_delegate);
648 659
649 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( 660 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory(
650 globals_->host_resolver.get())); 661 globals_->host_resolver.get()));
651 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); 662 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl());
652 // For the ProxyScriptFetcher, we use a direct ProxyService. 663 // For the ProxyScriptFetcher, we use a direct ProxyService.
653 globals_->proxy_script_fetcher_proxy_service.reset( 664 globals_->proxy_script_fetcher_proxy_service.reset(
654 net::ProxyService::CreateDirectWithNetLog(net_log_)); 665 net::ProxyService::CreateDirectWithNetLog(net_log_));
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 net::HttpNetworkSession::Params* params) { 992 net::HttpNetworkSession::Params* params) {
982 InitializeNetworkSessionParamsFromGlobals(*globals_, params); 993 InitializeNetworkSessionParamsFromGlobals(*globals_, params);
983 } 994 }
984 995
985 // static 996 // static
986 void IOThread::InitializeNetworkSessionParamsFromGlobals( 997 void IOThread::InitializeNetworkSessionParamsFromGlobals(
987 const IOThread::Globals& globals, 998 const IOThread::Globals& globals,
988 net::HttpNetworkSession::Params* params) { 999 net::HttpNetworkSession::Params* params) {
989 params->host_resolver = globals.host_resolver.get(); 1000 params->host_resolver = globals.host_resolver.get();
990 params->cert_verifier = globals.cert_verifier.get(); 1001 params->cert_verifier = globals.cert_verifier.get();
1002 params->cert_policy_enforcer = globals.cert_policy_enforcer.get();
991 params->channel_id_service = globals.system_channel_id_service.get(); 1003 params->channel_id_service = globals.system_channel_id_service.get();
992 params->transport_security_state = globals.transport_security_state.get(); 1004 params->transport_security_state = globals.transport_security_state.get();
993 params->ssl_config_service = globals.ssl_config_service.get(); 1005 params->ssl_config_service = globals.ssl_config_service.get();
994 params->http_auth_handler_factory = globals.http_auth_handler_factory.get(); 1006 params->http_auth_handler_factory = globals.http_auth_handler_factory.get();
995 params->http_server_properties = 1007 params->http_server_properties =
996 globals.http_server_properties->GetWeakPtr(); 1008 globals.http_server_properties->GetWeakPtr();
997 params->network_delegate = globals.system_network_delegate.get(); 1009 params->network_delegate = globals.system_network_delegate.get();
998 params->host_mapping_rules = globals.host_mapping_rules.get(); 1010 params->host_mapping_rules = globals.host_mapping_rules.get();
999 params->enable_ssl_connect_job_waiting = 1011 params->enable_ssl_connect_job_waiting =
1000 globals.enable_ssl_connect_job_waiting; 1012 globals.enable_ssl_connect_job_waiting;
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); 1428 net::QuicVersionVector supported_versions = net::QuicSupportedVersions();
1417 for (size_t i = 0; i < supported_versions.size(); ++i) { 1429 for (size_t i = 0; i < supported_versions.size(); ++i) {
1418 net::QuicVersion version = supported_versions[i]; 1430 net::QuicVersion version = supported_versions[i];
1419 if (net::QuicVersionToString(version) == quic_version) { 1431 if (net::QuicVersionToString(version) == quic_version) {
1420 return version; 1432 return version;
1421 } 1433 }
1422 } 1434 }
1423 1435
1424 return net::QUIC_VERSION_UNSUPPORTED; 1436 return net::QUIC_VERSION_UNSUPPORTED;
1425 } 1437 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698