Skip to content

Commit 71acd32

Browse files
committed
Allow web applications to select SFrame cipher suite as a parameter provided to SFrameTransform constructor.
Also updates the link to the SFrame specification now that it is a RFC.
1 parent cf0e77a commit 71acd32

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

index.bs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ spec:webidl; type:dfn; text:resolve
1919
</pre>
2020
<pre class=biblio>
2121
{
22-
"SFRAME": {
23-
"href":
24-
"https://www.ietf.org/archive/id/draft-ietf-sframe-enc-04.html",
25-
"title": "Secure Frame (SFrame)"
26-
},
2722
"VP9": {
2823
"href":
2924
"https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp9-bitstream-specification-v0.6-20160331-draft.pdf",
@@ -221,7 +216,7 @@ Similarly, if a web application sets the transform synchronously at creation of
221216
# SFrameTransform # {#sframe}
222217

223218
<p>
224-
The API presented in this section allows applications to process SFrame data as defined in [[SFrame]].
219+
The API presented in this section allows applications to process SFrame data as defined in [[RFC9605]].
225220
</p>
226221

227222
<xmp class="idl">
@@ -230,8 +225,17 @@ enum SFrameTransformRole {
230225
"decrypt"
231226
};
232227

228+
enum SFrameCipherSuite {
229+
"AES_128_CTR_HMAC_SHA256_80",
230+
"AES_128_CTR_HMAC_SHA256_64",
231+
"AES_128_CTR_HMAC_SHA256_32",
232+
"AES_128_GCM_SHA256_128",
233+
"AES_256_GCM_SHA512_128"
234+
};
235+
233236
dictionary SFrameTransformOptions {
234237
SFrameTransformRole role = "encrypt";
238+
required SFrameCipherSuite cipherSuite;
235239
};
236240

237241
typedef [EnforceRange] unsigned long long SmallCryptoKeyID;
@@ -269,12 +273,13 @@ dictionary SFrameTransformErrorEventInit : EventInit {
269273

270274
The <dfn constructor for="SFrameTransform" lt="SFrameTransform(options)"><code>new SFrameTransform(<var>options</var>)</code></dfn> constructor steps are:
271275
1. Let |transformAlgorithm| be an algorithm which takes a |frame| as input and runs the <a href="#sframe-transform-algorithm">SFrame transform algorithm</a> with |this| and |frame|.
272-
2. Set |this|.`[[transform]]` to a new {{TransformStream}}.
273-
3. <a dfn for="ReadableStream">Set up</a> [=this=].`[[transform]]` with [=TransformStream/set up/transformAlgorithm=] set to |transformAlgorithm|.
274-
4. Let |options| be the method's first argument.
275-
5. Set |this|.`[[role]]` to |options|["{{SFrameTransformOptions/role}}"].
276-
6. Set |this|.`[[readable]]` to |this|.`[[transform]]`.`[[readable]]`.
277-
7. Set |this|.`[[writable]]` to |this|.`[[transform]]`.`[[writable]]`.
276+
1. Set |this|.`[[transform]]` to a new {{TransformStream}}.
277+
1. <a dfn for="ReadableStream">Set up</a> [=this=].`[[transform]]` with [=TransformStream/set up/transformAlgorithm=] set to |transformAlgorithm|.
278+
1. Let |options| be the method's first argument.
279+
1. Set |this|.`[[role]]` to |options|["{{SFrameTransformOptions/role}}"].
280+
1. Set |this|.`[[cipherSuite]]` to |options|["{{SFrameTransformOptions/cipherSuite}}"].
281+
1. Set |this|.`[[readable]]` to |this|.`[[transform]]`.`[[readable]]`.
282+
1. Set |this|.`[[writable]]` to |this|.`[[transform]]`.`[[writable]]`.
278283

279284
## Algorithm ## {#sframe-transform-algorithm}
280285

@@ -287,7 +292,7 @@ The SFrame transform algorithm, given |sframe| as a SFrameTransform object and |
287292
1. If |frame| is a {{RTCEncodedAudioFrame}}, set |data| to |frame|.{{RTCEncodedAudioFrame/data}}
288293
1. If |frame| is a {{RTCEncodedVideoFrame}}, set |data| to |frame|.{{RTCEncodedVideoFrame/data}}
289294
1. If |data| is undefined, abort these steps.
290-
1. Let |buffer| be the result of running the SFrame algorithm with |data| and |role| as parameters. This algorithm is defined by the <a href="https://datatracker.ietf.org/doc/draft-omara-sframe/">SFrame specification</a> and returns an {{ArrayBuffer}}.
295+
1. Let |buffer| be the result of running the SFrame algorithm with |data|, |sframe|.`[[cipherSuite]]`, and |role| as parameters. This algorithm is defined by [[RFC9605]] and returns an {{ArrayBuffer}}.
291296
1. If the SFrame algorithm exits abruptly with an error, [=queue a task=] to run the following sub steps:
292297
1. If the processing fails on decryption side due to |data| not following the SFrame format, [=fire an event=] named {{SFrameTransform/onerror|error}} at |sframe|,
293298
using the {{SFrameTransformErrorEvent}} interface with its {{SFrameTransformErrorEvent/errorType}} attribute set to {{SFrameTransformErrorEventType/syntax}}
@@ -309,7 +314,7 @@ The <dfn method for="SFrameTransform">setEncryptionKey(|key|, |keyID|)</dfn> met
309314
1. Let |promise| be [=a new promise=].
310315
2. If |keyID| is a {{bigint}} which cannot be represented as a integer between 0 and 2<sup>64</sup>-1 inclusive, [=reject=] |promise| with a {{RangeError}} exception.
311316
3. Otherwise, [=in parallel=], run the following steps:
312-
1. Set |key| with its optional |keyID| as key material to use for the SFrame transform algorithm, as defined by the <a href="https://datatracker.ietf.org/doc/draft-omara-sframe/">SFrame specification</a>.
317+
1. Set |key| with its optional |keyID| as key material to use for the SFrame transform algorithm, as defined by [[RFC9605]].
313318
2. If setting the key material fails, [=reject=] |promise| with an {{InvalidModificationError}} exception and abort these steps.
314319
3. [=Resolve=] |promise| with undefined.
315320
4. Return |promise|.

0 commit comments

Comments
 (0)