Merge of widevine change http://go/wvgerrit/16249 This CL adds unit tests and reference code for the security patch level, which is a new feature in OEMCrypto v11. This CL also adjusts the dynamic and static adapters to still run with devices that have a v10 OEMCrypto. The level 3 haystack code will be updated in a future CL. bug: 26188985 Change-Id: I518ef46b4098cf3718fe0c0390bfb6825db4fb6b
60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
// Copyright 2014 Google Inc. All Rights Reserved.
|
|
//
|
|
// Mock implementation of OEMCrypto APIs
|
|
//
|
|
#include "oemcrypto_engine_mock.h"
|
|
|
|
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() {
|
|
return false;
|
|
}
|
|
|
|
// A closed platform is permitted to use clear buffers.
|
|
bool CryptoEngine::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;
|
|
}
|
|
|
|
// Returns the max HDCP version supported.
|
|
OEMCrypto_HDCP_Capability CryptoEngine::maximum_hdcp_capability() {
|
|
return HDCP_V2;
|
|
}
|
|
|
|
// Returns true if the client supports persistent storage of
|
|
// offline usage table information.
|
|
bool CryptoEngine::supports_storage() {
|
|
return true;
|
|
}
|
|
|
|
// Returns true if the client uses a keybox as the root of trust.
|
|
bool CryptoEngine::supports_keybox() {
|
|
return true;
|
|
}
|
|
|
|
// Returns false for mock library to indicate the client does not support
|
|
// anti-rollback hardware.
|
|
bool CryptoEngine::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() {
|
|
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() {
|
|
return 0;
|
|
}
|
|
|
|
} // namespace wvoec_mock
|