Source release v3.0.1 + third_party
This commit is contained in:
@@ -484,6 +484,14 @@ CdmResponseType CdmEngine::QueryStatus(SecurityLevel security_level,
|
||||
max_sessions_stream.str();
|
||||
}
|
||||
|
||||
uint32_t api_version;
|
||||
success = crypto_session.GetApiVersion(&api_version);
|
||||
if (success) {
|
||||
std::ostringstream api_version_stream;
|
||||
api_version_stream << api_version;
|
||||
(*key_info)[QUERY_KEY_OEMCRYPTO_API_VERSION] = api_version_stream.str();
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -605,12 +613,33 @@ CdmResponseType CdmEngine::HandleProvisioningResponse(
|
||||
return INVALID_PROVISIONING_PARAMETERS_2;
|
||||
}
|
||||
if (NULL == cert_provisioning_.get()) {
|
||||
LOGE("CdmEngine::HandleProvisioningResponse: provisioning object missing.");
|
||||
return EMPTY_PROVISIONING_CERTIFICATE;
|
||||
// Certificate provisioning object has been released. Check if a concurrent
|
||||
// provisioning attempt has succeeded before declaring failure.
|
||||
CryptoSession crypto_session;
|
||||
CdmResponseType status =
|
||||
crypto_session.Open(cert_provisioning_requested_security_level_);
|
||||
if (NO_ERROR != status) {
|
||||
LOGE(
|
||||
"CdmEngine::HandleProvisioningResponse: provisioning object "
|
||||
"missing and crypto session open failed.");
|
||||
return EMPTY_PROVISIONING_CERTIFICATE_2;
|
||||
}
|
||||
CdmSecurityLevel security_level = crypto_session.GetSecurityLevel();
|
||||
if (!IsProvisioned(security_level, origin)) {
|
||||
LOGE(
|
||||
"CdmEngine::HandleProvisioningResponse: provisioning object "
|
||||
"missing.");
|
||||
return EMPTY_PROVISIONING_CERTIFICATE_1;
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
CdmResponseType ret = cert_provisioning_->HandleProvisioningResponse(
|
||||
origin, response, cert, wrapped_key);
|
||||
cert_provisioning_.reset(NULL); // Release resources.
|
||||
// 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(NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user