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

@@ -6,40 +6,42 @@
namespace wvoec_mock {
// If local_display() returns true, we pretend we are using a built-in display,
// instead of HDMI or WiFi output.
bool CryptoEngine::local_display() {
// Configuration constants for CryptoEngine behavior
// If config_local_display_only() returns true, we pretend we are using a
// built-in display, instead of HDMI or WiFi output.
bool CryptoEngine::config_local_display_only() {
return false;
}
// A closed platform is permitted to use clear buffers.
bool CryptoEngine::closed_platform() {
bool CryptoEngine::config_closed_platform() {
return false;
}
// Returns the HDCP version currently in use.
OEMCrypto_HDCP_Capability CryptoEngine::current_hdcp_capability() {
return local_display() ? HDCP_NO_DIGITAL_OUTPUT : HDCP_V1;
OEMCrypto_HDCP_Capability CryptoEngine::config_current_hdcp_capability() {
return config_local_display_only() ? HDCP_NO_DIGITAL_OUTPUT : HDCP_V1;
}
// Returns the max HDCP version supported.
OEMCrypto_HDCP_Capability CryptoEngine::maximum_hdcp_capability() {
OEMCrypto_HDCP_Capability CryptoEngine::config_maximum_hdcp_capability() {
return HDCP_V2;
}
// Returns true if the client supports persistent storage of
// offline usage table information.
bool CryptoEngine::supports_storage() {
bool CryptoEngine::config_supports_usage_table() {
return true;
}
// Returns true if the client uses a keybox as the root of trust.
bool CryptoEngine::supports_keybox() {
bool CryptoEngine::config_supports_keybox() {
return true;
}
// This version uses a keybox.
OEMCrypto_ProvisioningMethod CryptoEngine::provisioning_method() {
OEMCrypto_ProvisioningMethod CryptoEngine::config_provisioning_method() {
return OEMCrypto_Keybox;
}
@@ -51,19 +53,19 @@ OEMCryptoResult CryptoEngine::get_oem_certificate(SessionContext *session,
// Returns false for mock library to indicate the client does not support
// anti-rollback hardware.
bool CryptoEngine::is_anti_rollback_hw_present() {
bool CryptoEngine::config_is_anti_rollback_hw_present() {
return false;
}
// Returns "L3" for a software only library. L1 is for hardware protected
// data paths.
const char* CryptoEngine::security_level() {
const char* CryptoEngine::config_security_level() {
return "L3";
}
// This should start at 0, and be incremented only when a security patch has
// been applied to the device that fixes a security bug.
uint8_t CryptoEngine::security_patch_level() {
uint8_t CryptoEngine::config_security_patch_level() {
return 0;
}