Add OEMCrypto_IsAntiRollbackHwPresent API for OEMCrypto v10.

Merge from WV CDM repo: https://widevine-internal-review.googlesource.com/#/c/13660/.

bug: 18948905
Change-Id: I1ffe72baaac9abf05c06139de790236e763f89a8
This commit is contained in:
Edwin Wong
2015-03-17 13:51:20 -07:00
parent a8243b75fe
commit a7887f60fc
11 changed files with 64 additions and 9 deletions

View File

@@ -97,6 +97,7 @@ class CryptoSession {
const std::string& message, const std::string& signature,
const std::string& provider_session_token);
virtual CdmResponseType DeleteAllUsageReports();
virtual bool IsAntiRollbackHwPresent();
virtual bool GetHdcpCapabilities(OemCryptoHdcpVersion* current,
OemCryptoHdcpVersion* max);

View File

@@ -864,6 +864,10 @@ CdmResponseType CryptoSession::DeleteAllUsageReports() {
return NO_ERROR;
}
bool CryptoSession::IsAntiRollbackHwPresent() {
return OEMCrypto_IsAntiRollbackHwPresent(requested_security_level_);
}
bool CryptoSession::GenerateNonce(uint32_t* nonce) {
if (!nonce) {
LOGE("input parameter is null");

View File

@@ -274,6 +274,14 @@ bool CdmLicense::PrepareKeyRequest(const InitializationData& init_data,
client_capabilities->set_session_token(supports_usage_information);
}
client_capabilities->set_anti_rollback_hardware_present(
session_->IsAntiRollbackHwPresent());
uint32_t api_version = 0;
if (session_->GetApiVersion(&api_version)) {
client_capabilities->set_oem_crypto_api_version(api_version);
}
CryptoSession::OemCryptoHdcpVersion current_version, max_version;
if (session_->GetHdcpCapabilities(&current_version, &max_version)) {
switch (max_version) {
@@ -315,11 +323,6 @@ bool CdmLicense::PrepareKeyRequest(const InitializationData& init_data,
}
}
uint32_t version = 0;
if (session_->GetApiVersion(&version)) {
client_capabilities->set_oem_crypto_api_version(version);
}
if (privacy_mode_enabled) {
EncryptedClientIdentification* encrypted_client_id =
license_request.mutable_encrypted_client_id();

View File

@@ -410,6 +410,7 @@ message ClientIdentification {
optional bool video_resolution_constraints = 3 [default = false];
optional HdcpVersion max_hdcp_version = 4 [default = HDCP_NONE];
optional uint32 oem_crypto_api_version = 5;
optional bool anti_rollback_hardware_present = 6 [default = false];
}
// Type of factory-provisioned device root of trust. Optional.