This is a merge from the widevine repository of http://go/wvgerrit/13923 Switch openssl to use the EVP interface for aes-ctr-128 http://go/wvgerrit/13979 Add Test Certificate to OEMCrypto Mock http://go/wvgerrit/13978 Add Test Keybox to Level 3 OEMCrypto http://go/wvgerrit/13873 Enable OEMCrypto Unit Tests This CL adds a main program to oemcrypto_test.cpp, which filters out tests that are not supported on the specified platform. It also adds LoadTestKeybox to the mock. This allows oemcrypto unit tests to be run on devices that have production keybox. It also allows the same set of unit tests to work on Android and on non-Android platforms. b/18962381 Use test certificate (partial fix) b/19867990 Separate cast receiver tests Change-Id: If89c31530103ed85aa37d7379bd5b4dc2a927f38
54 lines
1.4 KiB
C++
54 lines
1.4 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";
|
|
}
|
|
|
|
} // namespace wvoec_mock
|