diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/feedback/anonymizer_tool.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/feedback/anonymizer_tool.cc')
-rw-r--r-- | chromium/components/feedback/anonymizer_tool.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/chromium/components/feedback/anonymizer_tool.cc b/chromium/components/feedback/anonymizer_tool.cc index 4f535ccf9fb..e4b8b7f7cb1 100644 --- a/chromium/components/feedback/anonymizer_tool.cc +++ b/chromium/components/feedback/anonymizer_tool.cc @@ -127,7 +127,7 @@ std::string MaybeScrubIPAddress(const std::string& addr) { net::IPAddress ip_addr; int prefix_length; bool scrub; - } static const kWhitelistedIPRanges[] = { + } static const kNonIdentifyingIPRanges[] = { // Private. {net::IPAddress(10, 0, 0, 0), 8, true}, {net::IPAddress(172, 16, 0, 0), 12, true}, @@ -172,7 +172,7 @@ std::string MaybeScrubIPAddress(const std::string& addr) { if (input_addr.AssignFromIPLiteral(addr) && input_addr.IsValid()) { bool mapped = MaybeUnmapAddress(&input_addr); bool translated = !mapped ? MaybeUntranslateAddress(&input_addr) : false; - for (const auto& range : kWhitelistedIPRanges) { + for (const auto& range : kNonIdentifyingIPRanges) { if (IPAddressMatchesPrefix(input_addr, range.ip_addr, range.prefix_length)) { std::string prefix; @@ -631,15 +631,15 @@ std::string AnonymizerTool::AnonymizeCustomPatternWithContext( return result; } -// This takes a |url| argument and returns true if the URL is whitelisted and -// does NOT need to be redacted, returns false otherwise. -bool IsUrlWhitelisted(re2::StringPiece url, - const char* const* first_party_extension_ids) { - // We do not whitelist anything with a query parameter. +// This takes a |url| argument and returns true if the URL is exempt from +// redaction, returns false otherwise. +bool IsUrlExempt(re2::StringPiece url, + const char* const* first_party_extension_ids) { + // We do not exempt anything with a query parameter. if (url.contains("?")) return false; - // Check for whitelisting of chrome:// URLs. + // Check for chrome:// URLs that are exempt. if (url.starts_with("chrome://")) { // We allow everything in chrome://resources/. if (url.starts_with("chrome://resources/")) @@ -652,11 +652,10 @@ bool IsUrlWhitelisted(re2::StringPiece url, return false; } - // If the whitelist is null, then don't check it. if (!first_party_extension_ids) return false; - // Whitelist URLs of the format chrome-extension://<first-party-id>/*.js + // Exempt URLs of the format chrome-extension://<first-party-id>/*.js if (!url.starts_with("chrome-extension://")) return false; @@ -693,7 +692,7 @@ std::string AnonymizerTool::AnonymizeCustomPatternWithoutContext( re2::StringPiece skipped; re2::StringPiece matched_id; while (FindAndConsumeAndGetSkipped(&text, *re, &skipped, &matched_id)) { - if (IsUrlWhitelisted(matched_id, first_party_extension_ids_)) { + if (IsUrlExempt(matched_id, first_party_extension_ids_)) { skipped.AppendToString(&result); matched_id.AppendToString(&result); continue; |