• Istiaque Ahmed's avatar
    CV: Fix verification for incorrect case filename in case-sensitive OS. · 9e52c8d2
    Istiaque Ahmed authored
    Content verification currently always performs case-insensitive
    searches (by using lower case keys in VerifiedContents::root_hashes_,
    or by searching using CompareEqualsIgnoreCase in ComputedHashes) to
    support case-insensitive systems (win/mac). However, currently this
    applies to case-sensitive systems (linux/cros) as well. The
    effect is that a request to manifesT.json for example would return the
    hash of manifest.json but file read of manifesT.json would not be found.
    Therefore, the hashes would mismatch, incorrectly disabling the
    extension due to content-verification failure.
    
    This CL changes case-insensitive logic to only apply for
    case-insensitive systems (win/mac) and not case-sensitive ones
    (linux/cros).
    
    This CL also moves case-sensitivity and dot-space logic to
    central location under content_verifier_utils.
    
    This CL also updates test expectations for existing tests and
    adds a regression test for the fix.
    
    Bug: 1033294
    Change-Id: Ied57039e316ce7c5e5a57fcec96f28ddeac305dc
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1993940
    Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
    Reviewed-by: default avatarOleg Davydov <burunduk@chromium.org>
    Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#731874}
    9e52c8d2
verified_contents.h 3.94 KB