diff options
Diffstat (limited to 'chromium/components/feedback/anonymizer_tool.cc')
-rw-r--r-- | chromium/components/feedback/anonymizer_tool.cc | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/chromium/components/feedback/anonymizer_tool.cc b/chromium/components/feedback/anonymizer_tool.cc index bc8a223cada..198f979a0ab 100644 --- a/chromium/components/feedback/anonymizer_tool.cc +++ b/chromium/components/feedback/anonymizer_tool.cc @@ -41,11 +41,12 @@ namespace { // (?-s) turns off "dot matches newline" for the remainder of the regex. // (?:regex) denotes non-capturing parentheses group. const char* kCustomPatternsWithContext[] = { - "(\\bCell ID: ')([0-9a-fA-F]+)(')", // ModemManager - "(\\bLocation area code: ')([0-9a-fA-F]+)(')", // ModemManager - "(?i-s)(\\bssid[= ]')(.+)(')", // wpa_supplicant - "(?-s)(\\bSSID - hexdump\\(len=[0-9]+\\): )(.+)()", // wpa_supplicant - "(?-s)(\\[SSID=)(.+?)(\\])", // shill + "(\\bCell ID: ')([0-9a-fA-F]+)(')", // ModemManager + "(\\bLocation area code: ')([0-9a-fA-F]+)(')", // ModemManager + "(?i-s)(\\bssid[= ]')(.+)(')", // wpa_supplicant + "(?-s)(\\bSSID - hexdump\\(len=[0-9]+\\): )(.+)()", // wpa_supplicant + "(?-s)(\\[SSID=)(.+?)(\\])", // shill + "(?i-s)(serial\\s*number\\s*:\\s*)([0-9a-zA-Z\\-]+)()", // Serial numbers }; // Helper macro: Non capturing group @@ -164,14 +165,18 @@ const char* kCustomPatternsWithContext[] = { // The |kCustomPatternWithoutContext| array defines further patterns to match // and anonymize. Each pattern consists of a single capturing group. CustomPatternWithoutContext kCustomPatternsWithoutContext[] = { - {"URL", "(?i)(" IRI ")"}, - // Email Addresses need to come after URLs because they can be part - // of a query parameter. - {"email", "(?i)([0-9a-z._%+-]+@[a-z0-9.-]+\\.[a-z]{2,6})"}, - // IP filter rules need to come after URLs so that they don't disturb the - // URL pattern in case the IP address is part of a URL. - {"IPv4", "(?i)(" IPV4ADDRESS ")"}, - {"IPv6", "(?i)(" IPV6ADDRESS ")"}, + {"URL", "(?i)(" IRI ")"}, + // Email Addresses need to come after URLs because they can be part + // of a query parameter. + {"email", "(?i)([0-9a-z._%+-]+@[a-z0-9.-]+\\.[a-z]{2,6})"}, + // IP filter rules need to come after URLs so that they don't disturb the + // URL pattern in case the IP address is part of a URL. + {"IPv4", "(?i)(" IPV4ADDRESS ")"}, + {"IPv6", "(?i)(" IPV6ADDRESS ")"}, + // Universal Unique Identifiers (UUIDs). + {"UUID", + "(?i)([0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-" + "[0-9a-zA-Z]{12})"}, }; // Like RE2's FindAndConsume, searches for the first occurrence of |pattern| in |