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

Side by Side Diff: components/cronet/android/cronet_url_request_context_adapter.cc

Issue 2493863002: [Cronet] Ignore Certificate Transparency to avoid CT log expiration. (Closed)
Patch Set: Use IgnoresCTVerifier / PolicyEnforcer on iOS. Created 4 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/cronet/android/cronet_url_request_context_adapter.h" 5 #include "components/cronet/android/cronet_url_request_context_adapter.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 15 matching lines...) Expand all
26 #include "base/memory/ptr_util.h" 26 #include "base/memory/ptr_util.h"
27 #include "base/memory/scoped_vector.h" 27 #include "base/memory/scoped_vector.h"
28 #include "base/message_loop/message_loop.h" 28 #include "base/message_loop/message_loop.h"
29 #include "base/metrics/histogram_macros.h" 29 #include "base/metrics/histogram_macros.h"
30 #include "base/metrics/statistics_recorder.h" 30 #include "base/metrics/statistics_recorder.h"
31 #include "base/single_thread_task_runner.h" 31 #include "base/single_thread_task_runner.h"
32 #include "base/time/time.h" 32 #include "base/time/time.h"
33 #include "base/values.h" 33 #include "base/values.h"
34 #include "components/cronet/android/cert/cert_verifier_cache_serializer.h" 34 #include "components/cronet/android/cert/cert_verifier_cache_serializer.h"
35 #include "components/cronet/android/cert/proto/cert_verification.pb.h" 35 #include "components/cronet/android/cert/proto/cert_verification.pb.h"
36 #include "components/cronet/ct_ignores.h"
36 #include "components/cronet/histogram_manager.h" 37 #include "components/cronet/histogram_manager.h"
37 #include "components/cronet/url_request_context_config.h" 38 #include "components/cronet/url_request_context_config.h"
38 #include "components/prefs/pref_change_registrar.h" 39 #include "components/prefs/pref_change_registrar.h"
39 #include "components/prefs/pref_filter.h" 40 #include "components/prefs/pref_filter.h"
40 #include "components/prefs/pref_registry_simple.h" 41 #include "components/prefs/pref_registry_simple.h"
41 #include "components/prefs/pref_service.h" 42 #include "components/prefs/pref_service.h"
42 #include "components/prefs/pref_service_factory.h" 43 #include "components/prefs/pref_service_factory.h"
43 #include "jni/CronetUrlRequestContext_jni.h" 44 #include "jni/CronetUrlRequestContext_jni.h"
44 #include "net/base/load_flags.h" 45 #include "net/base/load_flags.h"
45 #include "net/base/logging_network_change_observer.h" 46 #include "net/base/logging_network_change_observer.h"
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 http_server_properties_manager_ = http_server_properties_manager.get(); 599 http_server_properties_manager_ = http_server_properties_manager.get();
599 context_builder.SetHttpServerProperties( 600 context_builder.SetHttpServerProperties(
600 std::move(http_server_properties_manager)); 601 std::move(http_server_properties_manager));
601 } 602 }
602 603
603 // Explicitly disable the persister for Cronet to avoid persistence of dynamic 604 // Explicitly disable the persister for Cronet to avoid persistence of dynamic
604 // HPKP. This is a safety measure ensuring that nobody enables the persistence 605 // HPKP. This is a safety measure ensuring that nobody enables the persistence
605 // of HPKP by specifying transport_security_persister_path in the future. 606 // of HPKP by specifying transport_security_persister_path in the future.
606 context_builder.set_transport_security_persister_path(base::FilePath()); 607 context_builder.set_transport_security_persister_path(base::FilePath());
607 608
609 // Ignore Certificate Transparency to avoid log expiration (crbug.com/663883).
610 context_builder.set_ct_verifier(base::MakeUnique<IgnoresCTVerifier>());
611 context_builder.set_ct_policy_enforcer(
612 base::MakeUnique<IgnoresCTPolicyEnforcer>());
613
608 // Disable net::CookieStore and net::ChannelIDService. 614 // Disable net::CookieStore and net::ChannelIDService.
609 context_builder.SetCookieAndChannelIdStores(nullptr, nullptr); 615 context_builder.SetCookieAndChannelIdStores(nullptr, nullptr);
610 616
611 if (config->enable_network_quality_estimator) { 617 if (config->enable_network_quality_estimator) {
612 DCHECK(!network_quality_estimator_); 618 DCHECK(!network_quality_estimator_);
613 std::map<std::string, std::string> variation_params; 619 std::map<std::string, std::string> variation_params;
614 // Configure network quality estimator: Specify the algorithm that should 620 // Configure network quality estimator: Specify the algorithm that should
615 // be used for computing the effective connection type. The algorithm 621 // be used for computing the effective connection type. The algorithm
616 // is specified using the key-value pairs defined in 622 // is specified using the key-value pairs defined in
617 // //net/nqe/network_quality_estimator.cc. 623 // //net/nqe/network_quality_estimator.cc.
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 JNIEnv* env, 1100 JNIEnv* env,
1095 const JavaParamRef<jclass>& jcaller) { 1101 const JavaParamRef<jclass>& jcaller) {
1096 base::StatisticsRecorder::Initialize(); 1102 base::StatisticsRecorder::Initialize();
1097 std::vector<uint8_t> data; 1103 std::vector<uint8_t> data;
1098 if (!HistogramManager::GetInstance()->GetDeltas(&data)) 1104 if (!HistogramManager::GetInstance()->GetDeltas(&data))
1099 return ScopedJavaLocalRef<jbyteArray>(); 1105 return ScopedJavaLocalRef<jbyteArray>();
1100 return base::android::ToJavaByteArray(env, &data[0], data.size()); 1106 return base::android::ToJavaByteArray(env, &data[0], data.size());
1101 } 1107 }
1102 1108
1103 } // namespace cronet 1109 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698