Snap for 4686875 from db0911df54 to pi-release
Change-Id: I7a32241a67c7cf3b97db41b61c5d35c2889b3674
This commit is contained in:
@@ -854,12 +854,20 @@ CdmResponseType CdmEngine::HandleProvisioningResponse(
|
||||
}
|
||||
|
||||
bool CdmEngine::IsProvisioned(CdmSecurityLevel security_level) {
|
||||
DeviceFiles handle(file_system_);
|
||||
if (!handle.Init(security_level)) {
|
||||
LOGE("CdmEngine::IsProvisioned: unable to initialize device files");
|
||||
return false;
|
||||
// To validate whether the given security level is provisioned, we attempt to
|
||||
// initialize a CdmSession. This verifies the existence of a certificate and
|
||||
// attempts to load it. If this fails, initialization will return an error.
|
||||
UsagePropertySet property_set;
|
||||
property_set.set_security_level(
|
||||
security_level == kSecurityLevelL3 ? kLevel3 : kLevelDefault);
|
||||
|
||||
CdmSession session(file_system_, metrics_.AddSession());
|
||||
|
||||
CdmResponseType status = session.Init(&property_set);
|
||||
if (NO_ERROR != status) {
|
||||
LOGE("CdmEngine::IsProvisioned: CdmSession::Init returned %lu", status);
|
||||
}
|
||||
return handle.HasCertificate();
|
||||
return status == NO_ERROR;
|
||||
}
|
||||
|
||||
CdmResponseType CdmEngine::Unprovision(CdmSecurityLevel security_level) {
|
||||
|
||||
Reference in New Issue
Block a user