CSP: Distinguish port 0 from a default or empty port
The CSP data structures in Blink currently use a value of 0 to denote an unspecified or default-valued port in CSP source expressions. However, origins can also have ports explicitly set to 0. In order to resolve behavior inconsistencies between blink::SecurityOrigin, which currently doesn't support port 0, and url::Origin, which does, we're updating blink::SecurityOrigin to distinguish port-0 origins from origins with unspecified (default-valued) ports. This makes SourceListDirectiveTest.GetSources CSP tests fail, because it means that a "self" CSPSource created by ContentSecurityPolicy::SetupSelf from an origin with the default port will no longer have the same port as a CSPSource created by parsing a host-source source expression with no port. To fix this, we update CSPSource's port_ member to have a new default state denoting an unspecified or default-valued port, distinct from the value 0 which now specifically represents port 0. Bug: 1136678 Change-Id: Ic386fc2ba31e13c95676ecf050e24874d4af132e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2477044 Commit-Queue: David Van Cleve <davidvc@chromium.org> Reviewed-by:Andy Paicu <andypaicu@chromium.org> Cr-Commit-Position: refs/heads/master@{#823558}
Showing
This diff is collapsed.
Please register or sign in to comment