w3c / encrypted-media

Encrypted Media Extensions
https://w3c.github.io/encrypted-media/
Other
180 stars 80 forks source link

Clarify the size of a key ID #464

Closed vladimir-kazakov closed 1 year ago

vladimir-kazakov commented 4 years ago

Currently, EME says that it's just a sequence of octets, which, in my opinion, implies that it's "at least 1 byte."

Usually, content protection is used together with CENC, where the key ID is exactly 16 bytes. Okay, EME is not CENC, so they don't have to be equal, but in the issue #34, there is a comment that says:

The values in the commit above appear to be less than 128 bits. Also, they fail in Chrome.

This shows that Chrome expects key IDs to be at least 16 bytes. Sure, maybe this expectation is wrong, but then, what exactly must be expected?

EME also has an example, where multiple key IDs are exactly 16 bytes:

{
  "kids":
    [
     "LwVHf8JLtPrv2GUXFW2v_A",
     "0DdtU9od-Bh5L3xbv0Xf_A"
    ],
  "type":"temporary"
}

Does it mean that a key ID is exactly 16 bytes long?

To avoid any doubts and confusions, EME must explicitly mention the size of a key ID, and if it's variable, then the exact range must be specified, as well as the recommended (interoperable) size.

mounirlamouri commented 3 years ago

There is variation on what different key systems will accept wrt length. This may need an editorial note.

joeyparrish commented 1 year ago

Key ID size is specified by the encryption scheme and/or DRM vendor.