Closed Bug 2093437 Opened 9 days ago Closed 4 days ago

WebTransport.exportKeyingMaterial() rejects when called before the session is ready

Categories

(Core :: DOM: Networking, defect, P2)

defect

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: jesup, Assigned: jesup)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 external file)

Calling exportKeyingMaterial() on a WebTransport while its state is still "connecting" rejects with an InvalidStateError ("Failed to export keying material") instead of resolving once the session is established.

The spec (https://w3c.github.io/webtransport/#dom-webtransport-exportkeyingmaterial) only rejects synchronously when [[State]] is "closed" or "failed"; otherwise the export runs in parallel and resolves p with the keying material, aborting with an InvalidStateError only if the state becomes "closed" or "failed".

WebTransport::ExportKeyingMaterial() sends the IPC request immediately, but WebTransportParent::RecvExportKeyingMaterial() can only export once the session exists, so during "connecting" it resolves with Nothing() and the content process rejects.

This fails the WPT subtest "exportKeyingMaterial can be called while connecting" in all four variants of webtransport/export-keying-material.https.any.js (currently marked expected: FAIL). Test dashboard: https://tests.firefox.dev/test.html?test=testing/web-platform/tests/webtransport/export-keying-material.https.any.js

Fix: while "connecting", defer the request until [[Ready]] settles, as getStats() already does, and reject with an InvalidStateError if connecting fails.

The parent can only export keying material once the session is
established, so a call made while the state was "connecting" was
rejected. Defer the request until [[Ready]] settles, as getStats()
already does, and reject with an InvalidStateError if connecting fails.

Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]
Pushed by rjesup@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/1619fb846257 https://hg.mozilla.org/integration/autoland/rev/197f5b0b02cf wait for the session in exportKeyingMaterial() while the WebTransport is connecting r=necko-reviewers,kershaw,saschanaz
Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/988eed600127 https://hg.mozilla.org/integration/autoland/rev/b193daad5add Revert "Bug 2093437: wait for the session in exportKeyingMaterial() while the WebTransport is connecting r=necko-reviewers,kershaw,saschanaz"
Pushed by rjesup@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0b7d726d61f7 https://hg.mozilla.org/integration/autoland/rev/15c2ac7f6131 wait for the session in exportKeyingMaterial() while the WebTransport is connecting r=necko-reviewers,kershaw,saschanaz
Status: NEW → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: