Rename oemcrypto's CryptoEngine configuration functions.

Merge from Widevine repo of http://go/wvgerrit/22797

CryptoEngine has a number of functions that return constants that
control the configuration of mock OEMCrypto.  Give all the functions
a common prefix (config_) so their intent is more clear.

Change-Id: Idf9d3e9e8941fa0e793b0eb17a3f89bf634d9ed5
This commit is contained in:
Fred Gylys-Colwell
2017-01-20 17:02:12 -08:00
parent 3164194908
commit 5748860679
8 changed files with 104 additions and 97 deletions

View File

@@ -531,7 +531,7 @@ bool SessionContext::InstallKey(const KeyId& key_id,
}
if ((key_control_block.control_bits() &
kControlRequireAntiRollbackHardware) &&
!ce_->is_anti_rollback_hw_present()) {
!ce_->config_is_anti_rollback_hw_present()) {
LOGE("Anti-rollback hardware is required but hardware not present.");
return false;
}
@@ -773,7 +773,7 @@ OEMCryptoResult SessionContext::Generic_Decrypt(const uint8_t* in_buffer,
return OEMCrypto_ERROR_UNKNOWN_FAILURE;
}
if (control.control_bits() & kControlDataPathSecure) {
if (!ce_->closed_platform()) {
if (!ce_->config_closed_platform()) {
LOGE("[Generic_Decrypt(): control bit says secure path only.");
return OEMCrypto_ERROR_UNKNOWN_FAILURE;
}
@@ -1085,7 +1085,8 @@ OEMCryptoResult SessionContext::DecryptCENC(
}
const KeyControlBlock& control = current_content_key()->control();
if (control.control_bits() & kControlDataPathSecure) {
if (!ce_->closed_platform() && buffer_type == OEMCrypto_BufferType_Clear) {
if (!ce_->config_closed_platform() &&
buffer_type == OEMCrypto_BufferType_Clear) {
LOGE("[DecryptCTR(): Secure key with insecure buffer]");
return OEMCrypto_ERROR_DECRYPT_FAILED;
}
@@ -1102,16 +1103,16 @@ OEMCryptoResult SessionContext::DecryptCENC(
return OEMCrypto_ERROR_UNKNOWN_FAILURE;
}
}
if (!ce_->local_display()) { // Only look at HDCP if the display is not
// local.
if (!ce_->config_local_display_only()) {
// Only look at HDCP if the display is non-local.
if (control.control_bits() & kControlHDCPRequired) {
uint8_t required_hdcp =
(control.control_bits() & kControlHDCPVersionMask) >>
kControlHDCPVersionShift;
// For reference implementation, we pretend we can handle the current
// HDCP version.
if (required_hdcp > ce_->current_hdcp_capability() ||
ce_->current_hdcp_capability() == 0) {
if (required_hdcp > ce_->config_current_hdcp_capability() ||
ce_->config_current_hdcp_capability() == 0) {
return OEMCrypto_ERROR_INSUFFICIENT_HDCP;
}
}