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

Unified Diff: components/cronet/ios/Cronet.mm

Issue 2937523002: add setter for enable_pkp_bypass_etc (Closed)
Patch Set: add test for set_enable_pkp_bypass_etc Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/cronet/ios/Cronet.mm
diff --git a/components/cronet/ios/Cronet.mm b/components/cronet/ios/Cronet.mm
index caee74151420f79330071e89364690556ceacd8e..e30beea0a447f696a91a83804abdb354d054d147 100644
--- a/components/cronet/ios/Cronet.mm
+++ b/components/cronet/ios/Cronet.mm
@@ -49,6 +49,7 @@ NSURLCache* gPreservedSharedURLCache = nil;
BOOL gEnableTestCertVerifierForTesting = FALSE;
std::unique_ptr<net::CertVerifier> gMockCertVerifier;
NSString* gAcceptLanguages = nil;
+BOOL gEnablePKPBypassForLocalTrustAnchors = TRUE;
mef 2017/06/13 20:52:58 Hrm, we mix YES/NO and TRUE/FALSE in this file. T
lilyhoughton 2017/06/14 15:58:41 Done.
// CertVerifier, which allows any certificates for testing.
class TestCertVerifier : public net::CertVerifier {
@@ -236,6 +237,10 @@ class CronetHttpProtocolHandlerDelegate
gPkpList.push_back(std::move(pkp));
}
++ (void)setEnablePublicKeyPinningBypassForLocalTrustAnchors:(bool)enable {
mef 2017/06/13 20:52:58 BOOL
lilyhoughton 2017/06/14 15:58:41 Done.
+ gEnablePKPBypassForLocalTrustAnchors = enable;
+}
+
+ (void)startInternal {
std::string user_agent = base::SysNSStringToUTF8(gUserAgent);
@@ -253,6 +258,9 @@ class CronetHttpProtocolHandlerDelegate
gChromeNet.Get()->set_ssl_key_log_file_name(
base::SysNSStringToUTF8(gSslKeyLogFileName));
gChromeNet.Get()->set_pkp_list(std::move(gPkpList));
+ gChromeNet.Get()
+ ->set_enable_public_key_pinning_bypass_for_local_trust_anchors(
+ gEnablePKPBypassForLocalTrustAnchors);
for (const auto* quicHint : gQuicHints) {
gChromeNet.Get()->AddQuicHint(quicHint->host, quicHint->port,
quicHint->alternate_port);
« no previous file with comments | « no previous file | components/cronet/ios/cronet_environment.h » ('j') | components/cronet/ios/test/cronet_pkp_test.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698