Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: content/renderer/media/crypto/proxy_decryptor.cc

Issue 77413005: Remove support for non-JSON keys in AesDecryptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add pipeline_integration_tests Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/cdm/aes_decryptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/crypto/proxy_decryptor.cc
diff --git a/content/renderer/media/crypto/proxy_decryptor.cc b/content/renderer/media/crypto/proxy_decryptor.cc
index 1cf31ac96cffc7652e0731af954fd7f543859c11..810566919787140c2e2b84a5fe828de517a81096 100644
--- a/content/renderer/media/crypto/proxy_decryptor.cc
+++ b/content/renderer/media/crypto/proxy_decryptor.cc
@@ -149,9 +149,15 @@ void ProxyDecryptor::AddKey(const uint8* key,
// Clear Key using v0.1b, both arrays are used (|init_data| is key_id).
// Since the EME WD spec supports the key as a JSON Web Key,
// convert the 2 arrays to a JWK and pass it as the single array.
- // TODO(jrummell): When updating Decryptor interface to match WD, move the
- // workaround for handling |init_data| == null here.
- if (is_clear_key_ && init_data_length) {
+ if (is_clear_key_) {
+ // Decryptor doesn't support empty key ID (see http://crbug.com/123265).
+ // So ensure a non-empty value is passed.
+ if (!init_data) {
+ static const uint8 kDummyInitData[1] = {0};
+ init_data = kDummyInitData;
+ init_data_length = arraysize(kDummyInitData);
+ }
+
std::string jwk =
media::GenerateJWKSet(key, key_length, init_data, init_data_length);
DCHECK(!jwk.empty());
« no previous file with comments | « no previous file | media/cdm/aes_decryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698