Validate Service Certificates Before Accepting Them

(This is a merge of http://go/wvgerrit/14630)

To create a better flow when an application sets a service certificate
manually, we will now validate the certificate when it is given to us,
and if it is invalid, we will not allow the property to be set.

Bug: 21307186
Change-Id: If980ad075604223fc962a859fae93e98d86a7f4f
This commit is contained in:
John "Juce" Bruce
2015-06-12 11:46:32 -07:00
parent e6ea4ff2d0
commit c400a37d19
5 changed files with 36 additions and 14 deletions

View File

@@ -585,7 +585,11 @@ status_t WVDrmPlugin::setPropertyByteArray(const String8& name,
const Vector<uint8_t>& value) {
if (name == "serviceCertificate") {
std::string cert(value.begin(), value.end());
mPropertySet.set_service_certificate(cert);
if (WvContentDecryptionModule::IsValidServiceCertificate(cert)) {
mPropertySet.set_service_certificate(cert);
} else {
return android::BAD_VALUE;
}
} else {
ALOGE("App set unknown byte array property %s", name.string());
return android::ERROR_DRM_CANNOT_HANDLE;