diff --git a/index.html b/index.html index 61c7f69..ceea660 100644 --- a/index.html +++ b/index.html @@ -77,8 +77,8 @@ "id": "x690" } }, - "publishISODate": "2021-09-03T00:00:00.000Z", - "generatedSubtitle": "Editor's Draft 03 September 2021" + "publishISODate": "2021-09-13T00:00:00.000Z", + "generatedSubtitle": "Editor's Draft 13 September 2021" }
@@ -86,7 +86,7 @@

W3C Editor's Draft - +

This version:
@@ -196,7 +196,7 @@

Abstract

This document is governed by the 1 March 2019 W3C Process Document. -

@@ -708,11 +707,10 @@

8. Dependencies

9. Terminology

- The terms and algorithms + The terms ArrayBuffer, ArrayBufferView, and - - structured clone, + serializable objects, are defined by the HTML specification [HTML].

@@ -1182,44 +1180,60 @@

13.4 CryptoK

-
-

13.5 Structured clone algorithm

+
+

13.5 Serialization and deserialization steps

- When a user agent is required to obtain a structured clone - of a CryptoKey object, it must run the following steps. + CryptoKey objects are serializable objects. Their serialization steps, + given value and serialized, are:

  1. - Let input and memory be the corresponding inputs defined by the - internal structured cloning algorithm, where - input represents a CryptoKey object to be - cloned. + Set serialized.[[Type]] to the [[type]] internal slot of value.
  2. - Let output be a newly constructed CryptoKey - object. + Set serialized.[[Extractable]] to the [[extractable]] internal slot of value.
  3. - Let the [[type]], [[extractable]], [[algorithm]], and [[usages]] internal slots of output - be set to the result of invoking the internal structured clone algorithm recursively - on the corresponding internal slots of input, with the slot contents as the - new "input" argument and memory as the new "memory" - argument. + Set serialized.[[Algorithm]] to the sub-serialization of the + [[algorithm]] internal slot of value.
  4. - Let the [[handle]] internal slot of - output refer to the same cryptographic key data represented by the - [[handle]] internal slot of input. + Set serialized.[[Usages]] to the sub-serialization of the + [[usages]] internal slot of value. +
  5. +
  6. + Set serialized.[[Handle]] to the [[handle]] internal slot of value. +
  7. +
+

+ Their deserialization steps, given serialized and value, are: +

+
    +
  1. + Initialize the [[type]] internal slot of value to serialized.[[Type]]. +
  2. +
  3. + Initialize the [[extractable]] internal slot of value to serialized.[[Extractable]]. +
  4. +
  5. + Initialize the [[algorithm]] internal slot of value to the + sub-deserialization of serialized.[[Algorithm]]. +
  6. +
  7. + Initialize the [[usages]] internal slot of value to the + sub-deserialization of serialized.[[Usages]]. +
  8. +
  9. + Initialize the [[handle]] internal slot of value to serialized.[[Handle]].
Note
- When performing the structured clone algorithm in - order to serialize a CryptoKey object, implementations must not allow the - object to be deserialized as a different type. This is normatively required by the - definition of structured clone, but it merits specific attention, as such - deserialization may expose the contents of the [[handle]] internal slot, which in some - implementations may contain cryptographic key data that should not be exposed to - applications. + When deserializing a serialized CryptoKey object, it is important that the + object is not deserialized as a different type. This is normatively required by the + definition of the deserialization steps, but it merits specific attention, as + such deserialization may expose the contents of the key material, which in some + cases (such as when the [[extractable]] internal slot is false) should not + be exposed to applications.