Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent handling of invalid parameters #433

Open
jrummell-chromium opened this issue Dec 2, 2017 · 0 comments
Open

Inconsistent handling of invalid parameters #433

jrummell-chromium opened this issue Dec 2, 2017 · 0 comments
Labels
Milestone

Comments

@jrummell-chromium
Copy link
Contributor

Most of the parameters provided to the CDM are expected to be validated by the User Agent and return a TypeError if it's invalid. There are cases where the User Agent may not know how to validate a parameter, so additional validation may be done by the CDM. For example, section 6.7.1 for update() states how the CDM should handle an invalid |response| parameter:

6.7.1 If the format of sanitized response is invalid in any way, reject promise with a newly created TypeError.

However, if the CDM fails to process the |serverCertificate| provided for setServerCertificate(), the CDM must:

5.2 Use this object's cdm instance to process sanitized certificate.
5.3 If the preceding step failed, resolve promise with a new DOMException whose name is the appropriate error name.

Invalid data for setServerCertificate() results in a DOMException, while invalid data for Update() results in a TypeError. TypeError is not a DOMException.

Noticed this as the W3C EME test drm-invalid-license.https.html expects a TypeError when update() called with invalid data, while drm-mp4-syntax-mediakeys.https.html expects a DOMException when setServerCertificate() called with invalid data (new Uint8Array(200)).

@mounirlamouri mounirlamouri added this to the V2 milestone Sep 8, 2020
@joeyparrish joeyparrish modified the milestones: V2, V2-Bugfixes Sep 8, 2020
@joeyparrish joeyparrish modified the milestones: V2-Bugfixes, V3 Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants