summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjrummell@chromium.org <jrummell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-01 23:17:18 +0000
committerjrummell@chromium.org <jrummell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-01 23:17:18 +0000
commitb162073145ed4f26f42ac8e1971f2ba4b5b0b95e (patch)
tree1f4467a95e20a6168a126d2dac2d0d3f637755ee /content
parent31ccb31e7a8f4da575ab12e0f7c9438fd08c67e1 (diff)
downloadchromium_src-b162073145ed4f26f42ac8e1971f2ba4b5b0b95e.zip
chromium_src-b162073145ed4f26f42ac8e1971f2ba4b5b0b95e.tar.gz
chromium_src-b162073145ed4f26f42ac8e1971f2ba4b5b0b95e.tar.bz2
Verify that the key system is a concrete supported key system
When creating a WebContentDecryptionModule, verify that the key system is a concrete supported key system. This avoids fatal errors later when actually attempting to load the CDM, as only registered key systems will be allowed. BUG=349181 TEST=Reenabled test succeeds Review URL: https://codereview.chromium.org/210233004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/renderer/media/webcontentdecryptionmodule_impl.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/content/renderer/media/webcontentdecryptionmodule_impl.cc b/content/renderer/media/webcontentdecryptionmodule_impl.cc
index db2c519..bdb9f4e 100644
--- a/content/renderer/media/webcontentdecryptionmodule_impl.cc
+++ b/content/renderer/media/webcontentdecryptionmodule_impl.cc
@@ -13,6 +13,7 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "content/renderer/media/cdm_session_adapter.h"
+#include "content/renderer/media/crypto/key_systems.h"
#include "content/renderer/media/webcontentdecryptionmodulesession_impl.h"
#include "media/base/media_keys.h"
#include "third_party/WebKit/public/platform/WebString.h"
@@ -44,6 +45,10 @@ WebContentDecryptionModuleImpl* WebContentDecryptionModuleImpl::Create(
return NULL;
}
+ std::string key_system_ascii = base::UTF16ToASCII(key_system);
+ if (!IsConcreteSupportedKeySystem(key_system_ascii))
+ return NULL;
+
scoped_refptr<CdmSessionAdapter> adapter(new CdmSessionAdapter());
GURL security_origin_as_gurl(security_origin.toString());
@@ -51,7 +56,7 @@ WebContentDecryptionModuleImpl* WebContentDecryptionModuleImpl::Create(
#if defined(ENABLE_PEPPER_CDMS)
base::Bind(&PepperCdmWrapperImpl::Create, frame),
#endif
- base::UTF16ToASCII(key_system),
+ key_system_ascii,
security_origin_as_gurl)) {
return NULL;
}