Anonymize serial number in edid-decode output
This is already being anonymized by stripping the serial from the EDID
on input to edid-decode, but that means the checksum validity portion of
edid-decode is always wrong. This CL strips the serial number that is
output from edid-decode. Then we can stop stripping the serial number
from the input to edid-decode, since this will anonymize it instead.
Then at that point the checksum line in edid-decode will be correct.
Bug: 961857
Test: Unit tests pass, serial is redacted in a feedback report
Change-Id: If5a7413c140f0068f171c9035f3622175d5845ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1773704
Commit-Queue: J Kardatzke <[email protected]>
Reviewed-by: J Kardatzke <[email protected]>
Reviewed-by: Mike Frysinger <[email protected]>
Cr-Commit-Position: refs/heads/master@{#691381}
diff --git a/components/feedback/anonymizer_tool_unittest.cc b/components/feedback/anonymizer_tool_unittest.cc
index 686ac80..853338dd 100644
--- a/components/feedback/anonymizer_tool_unittest.cc
+++ b/components/feedback/anonymizer_tool_unittest.cc
@@ -193,6 +193,12 @@
AnonymizeCustomPatterns("SerialNumber: 5:00:14.0"));
EXPECT_EQ("Serial: <Serial: 6>",
AnonymizeCustomPatterns("Serial: ABCEFG\x01kjmn-as:342/234\\432"));
+ // Don't overly anonymize serial numbers, we only do this for a specific
+ // formatting case for edid-decode.
+ EXPECT_EQ("Foo serial number 123",
+ AnonymizeCustomPatterns("Foo serial number 123"));
+ EXPECT_EQ("Foo Serial Number <Serial: 7>",
+ AnonymizeCustomPatterns("Foo Serial Number 123"));
EXPECT_EQ("\"gaia_id\":\"<GAIA: 1>\"",
AnonymizeCustomPatterns("\"gaia_id\":\"1234567890\""));