// Copyright 2014 Google Inc. All Rights Reserved. // // Mock implementation of OEMCrypto APIs // #include "oemcrypto_engine_mock.h" namespace wvoec_mock { // 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::config_closed_platform() { return false; } // Returns the HDCP version currently in use. 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::config_maximum_hdcp_capability() { return HDCP_V2; } // Returns true if the client supports persistent storage of // offline usage table information. bool CryptoEngine::config_supports_usage_table() { return true; } // Returns true if the client uses a keybox as the root of trust. bool CryptoEngine::config_supports_keybox() { return true; } // This version uses a keybox. OEMCrypto_ProvisioningMethod CryptoEngine::config_provisioning_method() { return OEMCrypto_Keybox; } OEMCryptoResult CryptoEngine::get_oem_certificate(SessionContext *session, uint8_t *public_cert, size_t *public_cert_length) { return OEMCrypto_ERROR_NOT_IMPLEMENTED; } // Returns false for mock library to indicate the client does not support // anti-rollback hardware. 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::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::config_security_patch_level() { return 0; } } // namespace wvoec_mock