New CE CDM error for device revocation.

Devices may be revoked by the provisioning server resulting in an
error message contained within the provisioning response.  The CDM
core currently returns an error, but the CE CDM would map this to
an kUnexpectedError, which does not provide the information to the
CE client to react.  This situation is not immediately recoverable,
but may provide certain apps to use a different DRM plugin if they
support such a thing.

Documentation and tests are needed.

Bug: 179650038
Test: None
Change-Id: I892a23839758264ddd7b29fb739cb00d41d953f8
This commit is contained in:
Alex Dale
2023-08-30 14:53:39 -07:00
committed by Robert Shih
parent 269d1527cb
commit 386ca20974

View File

@@ -1254,11 +1254,24 @@ CdmResponseType CdmEngine::HandleProvisioningResponse(
const CdmResponseType ret = cert_provisioning_->HandleProvisioningResponse(
file_system_, response, cert, wrapped_key);
// Release resources only on success. It is possible that a provisioning
// attempt was made after this one was requested but before the response was
// received, which will cause this attempt to fail. Not releasing will
// allow for the possibility that the later attempt succeeds.
if (NO_ERROR == ret) cert_provisioning_.reset();
if (NO_ERROR == ret) {
// Release resources on success.
cert_provisioning_.reset();
} else if (DEVICE_REVOKED == ret) {
// If a device is revoked, future attempts will likely fail.
// Caller may attempt changing security level to recover.
LOGE("Device has been revoked, cannot provision: status = %s",
ret.ToString().c_str());
cert_provisioning_.reset();
} else {
// It is possible that a provisioning attempt was made after this one was
// requested but before the response was received, which will cause this
// attempt to fail. Not releasing will allow for the possibility that the
// later attempt succeeds.
LOGW("Provisioning failed, app may try again: status = %s",
ret.ToString().c_str());
}
return ret;
}