Bug 1518836 [wpt PR 14762] - SignedExchange: Set Accept header in certificate requests, a=testonly
authorKunihiko Sakamoto <ksakamoto@chromium.org>
Thu, 31 Jan 2019 15:46:32 +0000
changeset 457913 f2407fe5703239e0404572fcecfd1f28f2402232
parent 457912 6a9d65bb8b073e19c8d4ee2a70daf1de3ceeb993
child 457914 bffcaa7aec9c70f2dc4ad389891e46e482a6e4a9
push id35518
push useropoprus@mozilla.com
push dateFri, 08 Feb 2019 09:55:14 +0000
treeherdermozilla-central@3a3e393396f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1518836, 14762, 917286, 1399697, 621057
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1518836 [wpt PR 14762] - SignedExchange: Set Accept header in certificate requests, a=testonly Automatic update from web-platform-tests SignedExchange: Set Accept header in certificate requests SignedExchange certificate requests should have Accept: application/cert-chain+cbor header. Bug: 917286 Change-Id: Ibf24b17d7074c45d46c391469379367b8b13bb83 Reviewed-on: https://chromium-review.googlesource.com/c/1399697 Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Tsuyoshi Horo <horo@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Cr-Commit-Position: refs/heads/master@{#621057} -- wpt-commits: 9bb0f40e03f1ea84e17a3f608774b7b66dd0dd0a wpt-pr: 14762
testing/web-platform/tests/signed-exchange/check-cert-request.tentative.html
testing/web-platform/tests/signed-exchange/resources/check-cert-request.py
testing/web-platform/tests/signed-exchange/resources/check-cert-request.sxg
testing/web-platform/tests/signed-exchange/resources/check-cert-request.sxg.headers
testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/signed-exchange/check-cert-request.tentative.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<title>Verify that certificate request has correct parameters.</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>
+<script>
+promise_test(async (t) => {
+  const sxgUrl = get_host_info().HTTPS_ORIGIN + '/signed-exchange/resources/check-cert-request.sxg';
+  const message = await openSXGInIframeAndWaitForMessage(t, sxgUrl);
+  assert_equals(message.location, innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
+  assert_false(message.is_fallback);
+}, 'Verify that certificate request has correct parameters.');
+
+</script>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/signed-exchange/resources/check-cert-request.py
@@ -0,0 +1,11 @@
+import os
+
+def main(request, response):
+    CertChainMimeType = "application/cert-chain+cbor"
+
+    if request.headers.get("Accept") != CertChainMimeType:
+        return 400, [], "Bad Request"
+
+    path = os.path.join(os.path.dirname(__file__), "127.0.0.1.sxg.pem.cbor")
+    body = open(path, "rb").read()
+    return 200, [("Content-Type", CertChainMimeType)], body
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..05f1646cfeb72d4c697ec73cee8855b787667568
GIT binary patch
literal 956
zc$}3|Id2m|7&TB~{s0BV;wFimJ?z-=xkicOE4Je!j*k>X<K54@WADYz*s&d@NkK!I
zh6bbnLPB(i1_^4qNC-i}A4owNMWSSFV<}XKo#va-JLbJvGE)3(C*X2DP${)YjOYD<
zFef<6ABzNoL7rg60GWl6q#{EB-Ueb0YzYXD4Fha;U~8O8b<K6-%;kEap$=$q#vzH`
zQhG0yuWqGw$Kz;j%Lp2Qv0X-ujl%jMQl{;KuOUq^ZI6AKp0OE;$a@=kWnZBAU}UFS
zi}v(f3kut6SS@#zs#I$V!&cAY>-}M7Gn?&4tD-l~43UOqOvlq(h@SsWu$Z`o4yO~v
z6KAkNL9v~^=#jAkgz`FOiHZWDbyiq&020{rZ_h*Mu$G2s*R*wxI+TBTODafxb|z%Q
zqk+TVtnos6?j?Gy-M#3b)s;h9v!?a;b>9S3R2;RsO?9)AhwW@7voS3BqH2ar>yQxz
z(H{x~LO~%S2yq5R7IrMBXKVgoXk8Fa&ayEbsA|foY`Xp`GtbwGUJoet73^!YQ+m_i
zQ}V5CrDulI;YrDt4x5b~qp*WYxSrqT5tjO5Hby9-1Cj~|LQyiE<_yZxu?4NW6h@Sv
z{u@pz71;!+IG|lNQdz*jkW3jHO7Xh8YyQcJ`&;Eyy<JH&Q;DQIK{3@JnVNGMv&-zx
z%FWg5mGqx}6Z{<HP7uk)7EQVju_2p>9Fpbq(4iGEaoAulFX=!CdR@I-`&P^S{FsZL
zKIXo}PR`G6J$yMifB)vrhsz6ir@+!GvkX(_3L_?&BR9j$cAQf+;w;m4Ud<%5G!;`|
z`A9P*M6qea7}=Bt`V_f1;#3>Ds|+RwU8HFpB=uvAGZFInS>zz~<MiI!X0CB{p?!~e
g6V=<Fo<6_we7#wI@(Yev;_l<s85W!|!7sA?1|Ano?EnA(
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/signed-exchange/resources/check-cert-request.sxg.headers
@@ -0,0 +1,2 @@
+Content-Type: application/signed-exchange;v=b2
+X-Content-Type-Options: nosniff
--- a/testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh
+++ b/testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh
@@ -33,16 +33,31 @@ gen-signedexchange \
   -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-location.sxg \
   -miRecordSize 100
 
+# For check-cert-request.tentative.html
+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/check-cert-request.py \
+  -validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
+  -privateKey $keyfile \
+  -date 2018-04-01T00:00:00Z \
+  -expire 168h \
+  -o check-cert-request.sxg \
+  -miRecordSize 100
+
 # Request method is HEAD.
 gen-signedexchange \
   -version 1b2 \
   -method HEAD \
   -uri $inner_url_origin/signed-exchange/resources/inner-url.html \
   -status 200 \
   -content sxg-location.html \
   -certificate $certfile \