Source release v3.3.0
This commit is contained in:
@@ -88,7 +88,7 @@ class PropertySet : public CdmClientPropertySet {
|
||||
return 1;
|
||||
}
|
||||
|
||||
virtual void set_session_sharing_id(uint32_t id) OVERRIDE {
|
||||
virtual void set_session_sharing_id(uint32_t) OVERRIDE {
|
||||
// Unused on CE platforms.
|
||||
return;
|
||||
}
|
||||
@@ -117,6 +117,11 @@ class CdmImpl : public Cdm,
|
||||
// Cdm:
|
||||
virtual Status setServiceCertificate(const std::string& certificate) OVERRIDE;
|
||||
|
||||
virtual Status getServiceCertificateRequest(std::string* message) OVERRIDE;
|
||||
|
||||
virtual Status parseServiceCertificateResponse(
|
||||
const std::string& response, std::string* certificate) OVERRIDE;
|
||||
|
||||
virtual bool isProvisioned() OVERRIDE;
|
||||
|
||||
virtual Status removeProvisioning() OVERRIDE;
|
||||
@@ -126,6 +131,12 @@ class CdmImpl : public Cdm,
|
||||
virtual Status listStoredLicenses(
|
||||
std::vector<std::string>* key_set_ids) OVERRIDE;
|
||||
|
||||
virtual Status listUsageRecords(std::vector<std::string>* ksids) OVERRIDE;
|
||||
|
||||
virtual Status deleteUsageRecord(const std::string& key_set_id) OVERRIDE;
|
||||
|
||||
virtual Status deleteAllUsageRecords() OVERRIDE;
|
||||
|
||||
virtual Status createSession(SessionType session_type,
|
||||
std::string* session_id) OVERRIDE;
|
||||
|
||||
@@ -266,7 +277,8 @@ CdmImpl::~CdmImpl() {
|
||||
Cdm::Status CdmImpl::setServiceCertificate(const std::string& certificate) {
|
||||
|
||||
if (certificate.empty()) {
|
||||
LOGW("An empty licensing service certificate may be invalid.");
|
||||
LOGE("Service certificate string is empty.");
|
||||
return kTypeError;
|
||||
}
|
||||
|
||||
// Check for properly signed and well-formed certificate.
|
||||
@@ -279,6 +291,37 @@ Cdm::Status CdmImpl::setServiceCertificate(const std::string& certificate) {
|
||||
return kSuccess;
|
||||
}
|
||||
|
||||
Cdm::Status CdmImpl::getServiceCertificateRequest(std::string* message) {
|
||||
if (!message) {
|
||||
LOGE("Unable to return service certificate request - "
|
||||
"string return parameter not supplied");
|
||||
return kTypeError;
|
||||
}
|
||||
CdmKeyMessage request_message;
|
||||
if (!cdm_engine_.GetServiceCertificateRequest(message)) {
|
||||
LOGE("Unable to return service certificate request!");
|
||||
message->clear();
|
||||
return kTypeError;
|
||||
}
|
||||
return kSuccess;
|
||||
}
|
||||
|
||||
Cdm::Status CdmImpl::parseServiceCertificateResponse(
|
||||
const std::string& response, std::string* certificate) {
|
||||
if (!certificate) {
|
||||
LOGE("Unable to return service certificate - "
|
||||
"string return parameter not supplied");
|
||||
return kTypeError;
|
||||
}
|
||||
if (cdm_engine_.ParseServiceCertificateResponse(response, certificate) !=
|
||||
NO_ERROR) {
|
||||
LOGE("Failure parsing service certificate response!");
|
||||
certificate->clear();
|
||||
return kTypeError;
|
||||
}
|
||||
return kSuccess;
|
||||
}
|
||||
|
||||
bool CdmImpl::isProvisioned() {
|
||||
return cdm_engine_.IsProvisioned(kSecurityLevelL1);
|
||||
}
|
||||
@@ -309,6 +352,34 @@ Cdm::Status CdmImpl::listStoredLicenses(std::vector<std::string>* key_set_ids) {
|
||||
return kSuccess;
|
||||
}
|
||||
|
||||
Cdm::Status CdmImpl::listUsageRecords(std::vector<std::string>* ksids) {
|
||||
if (ksids == NULL) {
|
||||
LOGE("Missing vector parameter to receive KSIDs.");
|
||||
return kTypeError;
|
||||
}
|
||||
if (cdm_engine_.ListUsageRecords(
|
||||
property_set_.app_id(), kSecurityLevelL1, ksids) != NO_ERROR) {
|
||||
return kUnexpectedError;
|
||||
}
|
||||
return kSuccess;
|
||||
}
|
||||
|
||||
Cdm::Status CdmImpl::deleteUsageRecord(const std::string& key_set_id) {
|
||||
if (cdm_engine_.DeleteUsageRecord(
|
||||
property_set_.app_id(), kSecurityLevelL1, key_set_id) != NO_ERROR) {
|
||||
return kUnexpectedError;
|
||||
}
|
||||
return kSuccess;
|
||||
}
|
||||
|
||||
Cdm::Status CdmImpl::deleteAllUsageRecords() {
|
||||
if (cdm_engine_.ReleaseAllUsageInfo(
|
||||
property_set_.app_id(), kSecurityLevelL1) != NO_ERROR) {
|
||||
return kUnexpectedError;
|
||||
}
|
||||
return kSuccess;
|
||||
}
|
||||
|
||||
Cdm::Status CdmImpl::createSession(SessionType session_type,
|
||||
std::string* session_id) {
|
||||
if (session_id == NULL) {
|
||||
@@ -871,12 +942,19 @@ Cdm::Status CdmImpl::decrypt(const InputBuffer& input,
|
||||
|
||||
CdmSessionId empty_session_id;
|
||||
CdmResponseType result = cdm_engine_.Decrypt(empty_session_id, parameters);
|
||||
|
||||
if (result == NO_ERROR) {
|
||||
return kSuccess;
|
||||
}
|
||||
|
||||
if (result == NEED_KEY || result == SESSION_NOT_FOUND_FOR_DECRYPT) {
|
||||
LOGE("Key not available.");
|
||||
return kNoKey;
|
||||
}
|
||||
if (result == NO_ERROR) {
|
||||
return kSuccess;
|
||||
|
||||
if (result == INSUFFICIENT_OUTPUT_PROTECTION) {
|
||||
LOGE("Key usage blocked due to HDCP or display resolution constraints.");
|
||||
return kKeyUsageBlockedByPolicy;
|
||||
}
|
||||
|
||||
LOGE("Decrypt error: %d", result);
|
||||
@@ -1037,8 +1115,7 @@ void CdmImpl::OnSessionRenewalNeeded(const CdmSessionId& session_id) {
|
||||
}
|
||||
|
||||
void CdmImpl::OnSessionKeysChange(const CdmSessionId& session_id,
|
||||
const CdmKeyStatusMap& keys_status,
|
||||
bool has_new_usable_key) {
|
||||
const CdmKeyStatusMap& keys_status, bool) {
|
||||
KeyStatusMap& map = sessions_[session_id].key_statuses;
|
||||
|
||||
CdmKeyStatusMap::const_iterator it;
|
||||
|
||||
Reference in New Issue
Block a user