Allow Clearing of Privacy Cert

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

The ability to clear the privacy cert after setting it was
accidentally removed by adding validation, as an empty certificate is
invalid. This restores the ability to clear the certificate by not
validating if the value being set is empty.

Bug: 21923281
Change-Id: Ibb57481a398c9599163ab3512125a9d5b5fcaab4
This commit is contained in:
John "Juce" Bruce
2015-06-18 18:47:41 -07:00
parent 99a2346e3a
commit 968993cd05

View File

@@ -585,7 +585,8 @@ status_t WVDrmPlugin::setPropertyByteArray(const String8& name,
const Vector<uint8_t>& value) {
if (name == "serviceCertificate") {
std::string cert(value.begin(), value.end());
if (WvContentDecryptionModule::IsValidServiceCertificate(cert)) {
if (value.isEmpty() ||
WvContentDecryptionModule::IsValidServiceCertificate(cert)) {
mPropertySet.set_service_certificate(cert);
} else {
return android::BAD_VALUE;