Skip to content

Commit 9e07884

Browse files
committed
Issue w3c#80: Times in the record of key usage should be at session, not key, level
1 parent 4da9f78 commit 9e07884

File tree

2 files changed

+86
-70
lines changed

2 files changed

+86
-70
lines changed

encrypted-media-respec.html

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -921,11 +921,11 @@ <h2><a>MediaKeys</a> Interface</h2>
921921
<dd>
922922
<p class="issue"><a href="https://github.com/w3c/encrypted-media/issues/85">Issue 85</a> - There are concerns about the architectural implications of <code>"tracked"</code> sessions that are pending a TAG discussion. The outcome of this discussion could result in modification (including removal) of the feature.</p>
923923
<p>
924-
A session for which the license and any key(s) it contains SHALL NOT be persisted and for which a <var>record of key usage times</var> SHALL be persisted.
925-
The <var>record of key usage times</var> consists of a record of the key IDs of the keys used in the session, the <var>first decryption time</var> for each key and the <var>latest decryption time</var> for each key.
926-
A <a def-id="message"></a> of type <a def-id="message-type-license-release"></a> containing a record of key usage will be generated when <a def-id="remove"></a> is called and on every <a def-id="load"></a> call until the record is acknowledged by a response passed to <a def-id="update"></a>. Because the license and keys are not persisted, this record implicitly proves that the keys are no longer available in the session.
924+
A session for which the license and any key(s) it contains SHALL NOT be persisted and for which a <var>record of key usage</var> SHALL be persisted.
925+
The <var>record of key usage</var> consists of a record of the key IDs of the keys available in the session, the time at which the session was first used
926+
to decrypt content, the <var>first decryption time</var> and the latest time at which the session was used to decrypt content, the <var>latest decryption time</var>.
927+
A <a def-id="message"></a> of type <a def-id="message-type-license-release"></a> containing the <var>record of key usage</var> will be generated when <a def-id="remove"></a> is called and on every <a def-id="load"></a> call until the record is acknowledged by a response passed to <a def-id="update"></a>. Because the license and keys are not persisted, this record implicitly proves that the keys are no longer available in the session.
927928
</p>
928-
<p class="issue"><a href="https://github.com/w3c/encrypted-media/issues/80">Issue 80</a> - It has been proposed that usage should be recorded by session, not key.</p>
929929
<p>
930930
The session MUST be loadable via its <a def-id="session-id"></a> once <a def-id="update"></a> is called successfully.
931931
The application is responsible for managing any such storage that may be generated by the CDM.
@@ -1148,7 +1148,14 @@ <h2><a>MediaKeySession</a> Interface</h2>
11481148
</dd>
11491149
<dt><a def-id="tracked-session"></a></dt>
11501150
<dd>
1151-
<p>Let <var>requested license type</var> be a non-persistable license that will persist a <var>record of key usage</var>.</p>
1151+
<ol>
1152+
<li>
1153+
<p>Let this sessions <var>record of key usage</var> be <code>null</code>.</p>
1154+
</li>
1155+
<li>
1156+
<p>Let <var>requested license type</var> be a non-persistable license that will persist the <var>record of key usage</var>.</p>
1157+
</li>
1158+
</ol>
11521159
</dd>
11531160
<dt><a def-id="persistent-license-session"></a></dt>
11541161
<dd>
@@ -1296,7 +1303,19 @@ <h2><a>MediaKeySession</a> Interface</h2>
12961303
<dt>If <var>sessionType</var> is <a def-id="temporary-session"></a> and <var>sanitized response</var> does not specify that session data, including any license, key(s), or similar session data it contains, should be stored</dt>
12971304
<dd>Process <var>sanitized response</var>, not storing any session data.</dd>
12981305
<dt>If <var>sessionType</var> is <a def-id="tracked-session"></a> and <var>sanitized response</var> contains a non-persistable license</dt>
1299-
<dd>Process <var>sanitized response</var>, not storing any session data.
1306+
<dd>
1307+
<ol>
1308+
<li>
1309+
<p>
1310+
Process <var>sanitized response</var>, not storing any session data.
1311+
</p>
1312+
</li>
1313+
<li>
1314+
<p>
1315+
If processing <var>sanitized response</var> resulting in the addition of keys to the set of <a href="#known-key">known keys</a>, add these new keys to the session's <var>record of key usage</var>.
1316+
</p>
1317+
</li>
1318+
</ol>
13001319
</dd><dt>If <var>sessionType</var> is <a def-id="persistent-license-session"></a> and <var>sanitized response</var> contains a persistable license</dt>
13011320
<dd>Process <var>sanitized response</var>, storing the license/key(s) and related session data contained in <var>sanitized response</var>.
13021321
Such data MUST be stored such that only the <a def-id="origin"></a> of this object's <a def-id="document-concept"></a> can access it.
@@ -1331,7 +1350,7 @@ <h2><a>MediaKeySession</a> Interface</h2>
13311350
<dd>
13321351
<p>Run the following steps:</p>
13331352
<ol>
1334-
<li><p>Clear all stored session data associated with this object, including the <a def-id="sessionId"></a> and <var>record of key usage</var>.</p>
1353+
<li><p>Clear all stored session data associated with this object, including the <a def-id="sessionId"></a> and the <var>record of key usage</var>.</p>
13351354
<p class="note">A subsequent call to <a def-id="load"></a> with the value of this object's <a def-id="sessionId"></a> would fail because there is no data stored for that session ID.</p>
13361355
</li>
13371356
<li>
@@ -2044,12 +2063,12 @@ <h4>Encrypted Block Encountered</h4>
20442063
<ol>
20452064
<li>
20462065
<p>
2047-
If the <var>record of key usage</var> does not contain an entry for <var>block key ID</var>, add a new entry for <var>block key ID</var> with <var>first decrypt time</var> set to the current time.
2066+
If the session's <var>record of key usage</var> is <code>null</code>, initialize the <var>record of key usage</var> to contain the key ids for all <a href="#known-key">known keys</a>, setting <var>first decrypt time</var> to the current time.
20482067
</p>
20492068
</li>
20502069
<li>
20512070
<p>
2052-
Set the <var>latest decrypt time</var> of the entry for <var>block key ID</var> in the <var>record of key use</var> to the current time.
2071+
Set the <var>latest decrypt time</var> of the <var>record of key usage</var> to the current time.
20532072
</p>
20542073
</li>
20552074
</ol>
@@ -2360,7 +2379,7 @@ <h4>Behavior</h4>
23602379
<li>
23612380
<p>
23622381
For sessions of type <a def-id="tracked-session"></a>, in the <a def-id="remove"></a> and <a def-id="load"></a> algorithms, the <var>message</var> reflecting
2363-
the <var>record of key usage times</var> is a JSON object encoded in UTF-8 as described in <a href="#clear-key-release-format">License Release Format</a>.
2382+
the <var>record of key usage</var> is a JSON object encoded in UTF-8 as described in <a href="#clear-key-release-format">License Release Format</a>.
23642383
</p>
23652384
</li>
23662385
<li>
@@ -2457,18 +2476,12 @@ <h4>License Release Format</h4>
24572476
<p>This section describes the format of the license release message to be provided via the <a def-id="message-event-message-attribute"></a> attribute of the <a def-id="message"></a> event.</p>
24582477
<p>The format is a JSON object containing the following members:</p>
24592478
<dl>
2460-
<dt>"keys"</dt>
2461-
<dd>
2462-
An array of objects, each object containing the following members:
2463-
<dl>
2464-
<dt>"kid"</dt>
2465-
<dd>The base64url encoding of the octet sequence containing a key ID value.</dd>
2466-
<dt>"tfirst"</dt>
2467-
<dd>The <var>first decrypt time</var> for this key ID expressed as a number giving the time, in milliseconds since 01 January, 1970 UTC.</dd>
2468-
<dt>"tlatest"</dt>
2469-
<dd>The <var>latest decrypt time</var> for this key ID expressed as a number giving the time, in milliseconds since 01 January, 1970 UTC.</dd>
2470-
</dl>
2471-
</dd>
2479+
<dt>"kids"</dt>
2480+
<dd>An array of <a def-id="key-id">key IDs</a>. Each element of the array is the base64url encoding of the octet sequence containing the key ID value.</dd>
2481+
<dt>"tfirst"</dt>
2482+
<dd>The <var>first decrypt time</var> expressed as a number giving the time, in milliseconds since 01 January, 1970 UTC.</dd>
2483+
<dt>"tlatest"</dt>
2484+
<dd>The <var>latest decrypt time</var> expressed as a number giving the time, in milliseconds since 01 January, 1970 UTC.</dd>
24722485
</dl>
24732486

24742487
<p>When contained in the ArrayBuffer <a def-id="message-event-message-attribute"></a> attribute of a <a>MediaKeyMessageEvent</a> object, the JSON string is encoded in UTF-8 as specified in the Encoding specification [[!ENCODING]].
@@ -2480,14 +2493,9 @@ <h5>Example</h5>
24802493
<p>The following example is a license release for a temporary license for a single key ID. (Line breaks are for readability only.)</p>
24812494
<pre class="example highlight">
24822495
{
2483-
"keys":
2484-
[
2485-
{
2486-
"kid" : "67ef0gd8pvfd0",
2487-
"tfirst" : 1430425323757,
2488-
"tlatest" : 1430425383757
2489-
}
2490-
]
2496+
"kids": [ "67ef0gd8pvfd0", "77ef0gd8pvfd0" ],
2497+
"tfirst" : 1430425323757,
2498+
"tlatest" : 1430425383757
24912499
}
24922500
</pre>
24932501
</section>

0 commit comments

Comments
 (0)