Skip to content

Commit

Permalink
SignedExchange: Remove support for version 1b2
Browse files Browse the repository at this point in the history
This patch drops support for Signed Exchange of
"application/signed-exchange;v=b2" format. After this patch, loading
Signed Exchanges of version 1b2 will cause fallback redirect.

SignedExchangeEnvelopeTest and SignedExchangeSignatureVerifierTest
will remain TestWithParam<SignedExchangeVersion>, since that will be
useful when adding support for future versions.

Bug: 919424
Change-Id: I8f992c2d38e21ad2fc89b9c227295867f588a04a
Reviewed-on: https://chromium-review.googlesource.com/c/1428628
Reviewed-by: Kouhei Ueno <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Tsuyoshi Horo <[email protected]>
Reviewed-by: Kent Tamura <[email protected]>
Commit-Queue: Kunihiko Sakamoto <[email protected]>
Cr-Commit-Position: refs/heads/master@{#625134}
  • Loading branch information
irori authored and chromium-wpt-export-bot committed Jan 23, 2019
1 parent e188b4d commit 554f2b2
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
17 changes: 16 additions & 1 deletion signed-exchange/resources/generate-test-sxgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inner_url_origin=https://127.0.0.1:8444
wpt_test_origin=https://web-platform.test:8444
wpt_test_remote_origin=https://www1.web-platform.test:8444
cert_url_origin=$wpt_test_origin
sxg_content_type='content-type: application/signed-exchange;v=b2'
sxg_content_type='content-type: application/signed-exchange;v=b3'

set -e

Expand Down Expand Up @@ -40,6 +40,21 @@ gen-signedexchange \
-o sxg/sxg-location.sxg \
-miRecordSize 100

# A signed exchange of unsupported version.
gen-signedexchange \
-version 1b2 \
-uri $inner_url_origin/signed-exchange/resources/inner-url.html \
-status 200 \
-content sxg-location.html \
-certificate $certfile \
-certUrl $cert_url_origin/signed-exchange/resources/$certfile.cbor \
-validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
-privateKey $keyfile \
-date 2018-04-01T00:00:00Z \
-expire 168h \
-o sxg-version1b2.sxg \
-miRecordSize 100

# A valid Signed Exchange for testing referrer which logical origin is the wpt
# test origin.
gen-signedexchange \
Expand Down
Binary file added signed-exchange/resources/sxg-version1b2.sxg
Binary file not shown.
2 changes: 2 additions & 0 deletions signed-exchange/resources/sxg-version1b2.sxg.headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Content-Type: application/signed-exchange;v=b2
X-Content-Type-Options: nosniff
Binary file modified signed-exchange/resources/sxg/nested-sxg.sxg
Binary file not shown.
20 changes: 20 additions & 0 deletions signed-exchange/sxg-version1b2.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<title>Loading SignedHTTPExchange of unsupported version must fail</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="./resources/sxg-util.js"></script>
<body>
<p>Note: This test FAILs if your browser supports Signed Exchange version 1b2.</p>
<script>
promise_test(async (t) => {
const sxgUrl = get_host_info().HTTPS_ORIGIN +
'/signed-exchange/resources/sxg-version1b2.sxg';
const message = await openSXGInIframeAndWaitForMessage(t, sxgUrl);
const innerURL = innerURLOrigin() +
'/signed-exchange/resources/inner-url.html';
assert_equals(message.location, innerURL);
assert_true(message.is_fallback);
}, 'Loading SignedHTTPExchange of unsupported version must fail and fallback redirect.');
</script>
</body>

0 comments on commit 554f2b2

Please sign in to comment.