<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>24016</bug_id>
          
          <creation_ts>2013-12-06 01:32:24 +0000</creation_ts>
          <short_desc>Multiple outstanding key requests allowed</short_desc>
          <delta_ts>2013-12-09 15:45:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>Encrypted Media Extensions</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>LATER</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joe Steele">steele</reporter>
          <assigned_to name="Adrian Bateman [MSFT]">adrianba</assigned_to>
          <cc>ddorwin</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-media</cc>
    
    <cc>watsonm</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97228</commentid>
    <comment_count>0</comment_count>
    <who name="Joe Steele">steele</who>
    <bug_when>2013-12-06 01:32:24 +0000</bug_when>
    <thetext>It is possible for the browser get into a situation where multiple EME key requests are outstanding at the same time. Since they are asynchronous, the order the responses are received in is indeterminate. However there is no way to directly associate a response with its request today. 

Example: An application is playing back a video stream which makes frequent key requests (e.g. heart beat testing). If the delay between sending the request and receiving the response is longer than the heart beat interval, you are now in this situation. 

This could be addressed in a variety of ways:

* We could explicitly say that no additional key requests may be sent for a given key session until the outstanding request has been completed. 
* We could require a URL to be passed in with the update() call which the CDM could match against the outstanding requests.
* others?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97229</commentid>
    <comment_count>1</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2013-12-06 02:07:43 +0000</bug_when>
    <thetext>What specifically is the problem with such outstanding requests that you&apos;re trying to address? In other words, why do the requests and responses need to be associated (other than perhaps within the server-CDM protocol)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97253</commentid>
    <comment_count>2</comment_count>
    <who name="Adrian Bateman [MSFT]">adrianba</who>
    <bug_when>2013-12-06 17:37:56 +0000</bug_when>
    <thetext>(In reply to Joe Steele from comment #0) 
&gt; * We could require a URL to be passed in with the update() call which the
&gt; CDM could match against the outstanding requests.

Presumably any value that could be passed into the update() call as an additional parameter could also be included in the response from the server for those CDMs that need this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97254</commentid>
    <comment_count>3</comment_count>
    <who name="Joe Steele">steele</who>
    <bug_when>2013-12-06 17:53:52 +0000</bug_when>
    <thetext>(In reply to David Dorwin from comment #1)
&gt; What specifically is the problem with such outstanding requests that you&apos;re
&gt; trying to address? In other words, why do the requests and responses need to
&gt; be associated (other than perhaps within the server-CDM protocol)?

The requests may need to be processed in serial order. For example if request N+1 relies on information provided in response N. If the responses arrive in the wrong order, the processing could fail, even though the correct responses are all available. 

(In reply to Adrian Bateman from comment #2)
&gt; Presumably any value that could be passed into the update() call as an 
&gt; additional parameter could also be included in the response from the server
&gt; for those CDMs that need this?

True - however that would not allow supporting existing servers and content tied to those servers. 

This could also be handled in the app by tracking all the outstanding requests and sending the responses down in serial order. I guess we could write some boilerplate code for that and post it somewhere?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97256</commentid>
    <comment_count>4</comment_count>
    <who name="Adrian Bateman [MSFT]">adrianba</who>
    <bug_when>2013-12-06 18:10:41 +0000</bug_when>
    <thetext>(In reply to Joe Steele from comment #3)
&gt; This could also be handled in the app by tracking all the outstanding
&gt; requests and sending the responses down in serial order. I guess we could
&gt; write some boilerplate code for that and post it somewhere?

Can&apos;t the CDM cache or drop out of order responses? Presumably if this is common (because the requests are taking too long) then sooner or later playback is going to fail because the license service isn&apos;t keeping up with the media?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97259</commentid>
    <comment_count>5</comment_count>
    <who name="Joe Steele">steele</who>
    <bug_when>2013-12-06 18:29:13 +0000</bug_when>
    <thetext>(In reply to Adrian Bateman [MSFT] from comment #4)
&gt; (In reply to Joe Steele from comment #3)
&gt; &gt; This could also be handled in the app by tracking all the outstanding
&gt; &gt; requests and sending the responses down in serial order. I guess we could
&gt; &gt; write some boilerplate code for that and post it somewhere?
&gt; 
&gt; Can&apos;t the CDM cache or drop out of order responses? Presumably if this is
&gt; common (because the requests are taking too long) then sooner or later
&gt; playback is going to fail because the license service isn&apos;t keeping up with
&gt; the media?

It may be impossible for the CDM to distinguish between a response received out of order and a corrupted response, if the responses are encrypted. 

If the server lag is long-term, playback *is* going to start failing and it probably doesn&apos;t matter if the CDM fails because of out of order responses or because it can&apos;t get the keys fast enough. If the server lag is momentary, playback could start failing but might be able to continue if it receives responses in the right order. 

I think we can probably wait to see whether this is a problem in the real world. After some research into real-world heartbeat usage I don&apos;t think this scenario is common enough to worry about at this point. I will go ahead and close this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97260</commentid>
    <comment_count>6</comment_count>
    <who name="Joe Steele">steele</who>
    <bug_when>2013-12-06 18:30:24 +0000</bug_when>
    <thetext>We should wait for implementation experience before we do anything here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97334</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2013-12-09 15:45:31 +0000</bug_when>
    <thetext>I would expect a CDM that can generate multiple outstanding requests would need its own (secure) method to associate requests and responses, for example by including a sequence number in the protected part of the message.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>